Is there a preprocessor directive for detecting the C ++ 11 Standard standard library?

Is it possible to determine if the standard C ++ library supports C ++ 11 using the preprocessor directive?

I am currently working on a project that uses a dialect of C ++ 11, but with a standard C ++ library without C ++ 11 support (I need this to be able to link to non-C ++ 11 libraries).

I know that I can check C ++ 11 support with #if __cplusplus >= 201103L , but in my case it will evaluate to true. I need to know about the support of the standard C ++ library for C ++ 11.

+6
source share
2 answers

Function testing is an active area of โ€‹โ€‹research for a standard committee following the C ++ 14 standard (and beyond). There is Study Group 10 with its freely available mailing list , where current developments are discussed. For working meeting, this working paper N3694 was presented.

+3
source

My problem was on the iOS platform, where the choice of the libstd++ (GNU C++ standard library) was between libstd++ (GNU C++ standard library) and libc++ (LLVM C++ standard library with C++11 support) . I ended up using _GLIBCXX_ . The full code has ended:

 #ifndef _GLIBCXX_ template <class T> T&& move (T& arg) noexcept { return static_cast<T&&>(arg); } #endif 
+3
source

Source: https://habr.com/ru/post/949821/


All Articles