diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2017-11-13 03:59:22 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2017-11-13 03:59:22 +0000 |
commit | edd7e051d4797e23af84ea1d344d3ce55a156a98 (patch) | |
tree | 0976546429900eb6b2c660eca2beb8737a9f84e5 /include | |
parent | 7513814cb67718056745856645119b4aaf5b3429 (diff) |
Implement P0550R2: Transformation Trait remove_cvref
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/type_traits | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/type_traits b/include/type_traits index 6c111abfd..1dd50b82f 100644 --- a/include/type_traits +++ b/include/type_traits @@ -150,6 +150,7 @@ namespace std template <size_t Len, size_t Align = most_stringent_alignment_requirement> struct aligned_storage; template <size_t Len, class... Types> struct aligned_union; + template <class T> struct remove_cvref; // C++20 template <class T> struct decay; template <class... T> struct common_type; @@ -203,6 +204,8 @@ namespace std template <std::size_t Len, class... Types> using aligned_union_t = typename aligned_union<Len,Types...>::type; // C++14 template <class T> + using remove_cvref_t = typename remove_cvref<T>::type; // C++20 + template <class T> using decay_t = typename decay<T>::type; // C++14 template <bool b, class T=void> using enable_if_t = typename enable_if<b,T>::type; // C++14 @@ -1141,6 +1144,17 @@ template <class _Tp, class _Up> struct __is_same_uncvref : is_same<typename __uncvref<_Tp>::type, typename __uncvref<_Up>::type> {}; +#if _LIBCPP_STD_VER > 17 +// aligned_union - same as __uncvref +template <class _Tp> +struct remove_cvref { + using type = remove_cv_t<remove_reference_t<_Tp>>; +}; + +template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type; +#endif + + struct __any { __any(...); |