Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top