Features: Add cxx_explicit_conversions.

This commit is contained in:
Stephen Kelly 2014-04-03 19:12:26 +02:00
parent ac3a1b14c0
commit ebab2015f9
4 changed files with 19 additions and 0 deletions

View File

@ -42,6 +42,11 @@ The features known to this version of CMake are:
.. _N2346: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm
``cxx_explicit_conversions``
Explicit conversion operators, as defined in N2437_.
.. _N2437: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf
``cxx_final``
Override control ``final`` keyword, as defined in N2928_.

View File

@ -15,6 +15,9 @@ set(_cmake_feature_test_cxx_override "${GNU47_CXX11}")
# TODO: Should be supported by GNU 4.6
set(GNU46_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_constexpr "${GNU46_CXX11}")
# TODO: Should be supported by GNU 4.5
set(GNU45_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_explicit_conversions "${GNU45_CXX11}")
# TODO: Should be supported by GNU 4.4
set(GNU44_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")

View File

@ -48,6 +48,7 @@
F(cxx_defaulted_functions) \
F(cxx_delegating_constructors) \
F(cxx_deleted_functions) \
F(cxx_explicit_conversions) \
F(cxx_final) \
F(cxx_override) \
F(cxx_static_assert) \

View File

@ -0,0 +1,10 @@
class A
{
int m_i;
public:
explicit operator bool()
{
return m_i != 0;
}
};