Features: Add cxx_alias_templates.

This commit is contained in:
Stephen Kelly 2014-04-04 10:50:41 +02:00
parent 3300f78310
commit e1e292cd06
4 changed files with 18 additions and 0 deletions

View File

@ -12,6 +12,11 @@ command.
The features known to this version of CMake are:
``cxx_alias_templates``
Template aliases, as defined in N2258_.
.. _N2258: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf
``cxx_auto_type``
Automatic type deduction, as defined in N1984_.

View File

@ -9,6 +9,7 @@ set(GNU48_CXX11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 2011
set(_cmake_feature_test_cxx_inheriting_constructors "${GNU48_CXX11}")
# TODO: Should be supported by GNU 4.7
set(GNU47_CXX11 "${_oldestSupported} && __cplusplus >= 201103L")
set(_cmake_feature_test_cxx_alias_templates "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_delegating_constructors "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_final "${GNU47_CXX11}")
set(_cmake_feature_test_cxx_noexcept "${GNU47_CXX11}")

View File

@ -42,6 +42,7 @@
#include <assert.h>
#define FOR_EACH_CXX_FEATURE(F) \
F(cxx_alias_templates) \
F(cxx_auto_type) \
F(cxx_constexpr) \
F(cxx_decltype) \

View File

@ -0,0 +1,11 @@
template <typename T1, typename T2>
struct A
{
typedef T1 MyT1;
using MyT2 = T2;
};
using B = A<int, char>;
template<typename T>
using C = A<int, T>;