Is it possible to determine if C++ standard library has C++11 support using a preprocessor directive?
I'm currently working on a project which uses the C++11 language dialect, but with the a C++ standard library without C++11 support (I need this to be able to link with non C++11 libraries).
I'm aware of that I can test of C++11 support using the #if __cplusplus >= 201103L
, but in my case this will evaluate to true. I need to know about the C++ standard library support for C++11.
Testing for features is an active research direction for the Standard Committee going towards the next C++14 Standard (and beyond that). There is a Study Group 10 with its own freely accessible mailinglist where current development is being discussed. For the next meeting, this N3694 working paper has been submitted.
My problem was on the iOS platform where the choice of C++ standard library was between libstd++ (GNU C++ standard library)
and libc++ (LLVM C++ standard library with C++11 support)
. I ended up using the _GLIBCXX_
. The complete code ended up being:
#ifndef _GLIBCXX_
template <class T>
T&& move (T& arg) noexcept {
return static_cast<T&&>(arg);
}
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With