Features: Add cxx_inline_namespaces.
This commit is contained in:
parent
f9d04a96b5
commit
300ce2481e
|
@ -87,6 +87,11 @@ The features known to this version of CMake are:
|
|||
|
||||
.. _N2540: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm
|
||||
|
||||
``cxx_inline_namespaces``
|
||||
Inline namespaces, as defined in N2535_.
|
||||
|
||||
.. _N2535: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm
|
||||
|
||||
``cxx_lambdas``
|
||||
Lambda functions, as defined in N2927_.
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@ set(_cmake_feature_test_cxx_auto_type "${GNU44_CXX11}")
|
|||
set(_cmake_feature_test_cxx_defaulted_functions "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_deleted_functions "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_generalized_initializers "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_inline_namespaces "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_strong_enums "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_trailing_return_types "${GNU44_CXX11}")
|
||||
set(_cmake_feature_test_cxx_unicode_literals "${GNU44_CXX11}")
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
F(cxx_final) \
|
||||
F(cxx_generalized_initializers) \
|
||||
F(cxx_inheriting_constructors) \
|
||||
F(cxx_inline_namespaces) \
|
||||
F(cxx_lambdas) \
|
||||
F(cxx_noexcept) \
|
||||
F(cxx_nonstatic_member_init) \
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
namespace Lib
|
||||
{
|
||||
inline namespace Lib_1
|
||||
{
|
||||
template <typename T> class A;
|
||||
}
|
||||
|
||||
template <typename T> void g(T);
|
||||
}
|
||||
|
||||
struct MyClass {
|
||||
|
||||
};
|
||||
namespace Lib
|
||||
{
|
||||
template<>
|
||||
class A<MyClass> {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
void someFunc()
|
||||
{
|
||||
Lib::A<MyClass> a;
|
||||
g(a); // ok, Lib is an associated namespace of A
|
||||
}
|
Loading…
Reference in New Issue