
"Peter Dimov" <pdimov@pdimov.com> writes:
Suppose I want to implement a shared_ptr constructor taking std::unique_ptr. To avoid breaking pre-C++11 compilers, I need to, at least, know whether <memory> contains std::unique_ptr. (I'd also like to know if there's std::ref in <functional> because the specification of the constructor uses it.) But the config library doesn't seem to provide a way. There's no macro for std::unique_ptr, and there's no macro for "generic C++11 compiler and library".
To figure out if a specific library has been installed I've use CMakes try_run [1] to check if the compiler supports what I need and define the necessary macros. Most build-system should support some analogue. Although this is a build-only solution and might not be what you are looking for. [1] : http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:try_run -- Philipp Moeller