1
0
mirror of https://github.com/google/benchmark.git synced 2025-04-14 13:30:24 +08:00
benchmark/test/cxx11_test.cc
Roman Lebedev 1bc59dce27
Finish cxx version bump ()
* `CMakeLists.txt`: drop hopefully obsolete code

* README.md: update

* Unbreak `BENCHMARK_HAS_CXX11` macro

835365f99a stopped defining it,
but didn't un-conditionalize the code guarded under it...

* Drop `BENCHMARK_HAS_NO_VARIADIC_REGISTER_BENCHMARK`

We no longer support such an old gcc version

* `docs/user_guide.md`: proofread

* Add a test to ensure that `benchmark.h` remains C++14 header

* Revert `[[maybe_unused]]` changes - it requires C++17

* Also support C++11 standard for using the library

I don't think we want to support C++03 though,
but i suppose C++11 is palatable, at least right now.
2025-03-17 09:18:19 +00:00

13 lines
369 B
C++

#include "benchmark/benchmark.h"
#if defined(_MSC_VER)
#if _MSVC_LANG != 201402L
// MSVC, even in C++11 mode, dooes not claim to be in C++11 mode.
#error "Trying to compile C++11 test with wrong C++ standard"
#endif // _MSVC_LANG
#else // Non-MSVC
#if __cplusplus != 201103L
#error "Trying to compile C++11 test with wrong C++ standard"
#endif // Non-MSVC
#endif