While on the one hand the GNU Build System is mostly used to build C projects and an historical lack of C++ macros is suffered, on the other hand there were no C++11 specific macro to check for library compliance.
For this reason, I began writing my own set of macros some weeks ago starting from what I needed at the time: C++11 features in the <functional> header. So far, I have written the following macros which cover all the new C++11 features in that header:
- AX_CXX_HAVE_BAD_FUNCTION_CALL(): checks for std::bad_function_call.
- AX_CXX_HAVE_BIND(): checks for std::bind.
- AX_CXX_HAVE_BIT_AND(): checks for std::bit_and.
- AX_CXX_HAVE_BIT_OR(): checks for std::bit_or.
- AX_CXX_HAVE_BIT_XOR(): checks for std::bit_xor.
- AX_CXX_HAVE_CREF(): checks for std::cref.
- AX_CXX_HAVE_FUNCTION(): checks for std::function.
- AX_CXX_HAVE_HASH(): checks for std::hash.
- AX_CXX_HAVE_IS_BIND_EXPRESSION(): checks for std::is_bind_expression.
- AX_CXX_HAVE_IS_PLACEHOLDER(): checks for std::is_placeholder.
- AX_CXX_HAVE_MEM_FN(): checks for std::mem_fn.
- AX_CXX_HAVE_PLACEHOLDERS(): checks for std::placeholders.
- AX_CXX_HAVE_REF(): checks for std::ref.
- AX_CXX_HAVE_REFERENCE_WRAPPER(): checks for std::reference_wrapper.
All the macros except AX_CXX_HAVE_PLACEHOLDERS were submitted to the GNU Autoconf Archive some weeks ago and are already available for use: just follow the link on the macro name, download the m4 file and use it. I submitted AX_CXX_HAVE_PLACEHOLDERS this morning and I expect it to be available shortly: I will update this post as soon as this macro has been accepted.
For those who want to contribute to this set of macros, you can check out their GitHub repository.