diff --git a/libcxx/include/tuple b/libcxx/include/tuple index 30a958abcd3c..3a1752ee19c5 100644 --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -82,13 +82,15 @@ template class tuple_size; // undefined template class tuple_size>; template class tuple_element; // undefined template class tuple_element>; +template + using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; // C++14 // 20.4.1.5, element access: template typename tuple_element>::type& get(tuple&) noexcept; // constexpr in C++14 template - typename tuple_element>::type const& + typename const tuple_element>::type & get(const tuple&) noexcept; // constexpr in C++14 template typename tuple_element>::type&& @@ -152,6 +154,11 @@ public: typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; }; +#if _LIBCPP_STD_VER > 11 +template +using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; +#endif + // __tuple_leaf template ::value diff --git a/libcxx/include/utility b/libcxx/include/utility index 0a1a7f1d9233..8a7e1dcb9ef4 100644 --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -101,30 +101,30 @@ constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); template class tuple_size; template class tuple_element; -template struct tuple_size >; -template struct tuple_element<0, std::pair >; -template struct tuple_element<1, std::pair >; +template struct tuple_size >; +template struct tuple_element<0, pair >; +template struct tuple_element<1, pair >; template - typename tuple_element >::type& - get(std::pair&) noexcept; // constexpr in C++14 + typename tuple_element >::type& + get(pair&) noexcept; // constexpr in C++14 template - const typename const tuple_element >::type& - get(const std::pair&) noexcept; // constexpr in C++14 + const typename const tuple_element >::type& + get(const pair&) noexcept; // constexpr in C++14 template - typename tuple_element >::type&& - get(std::pair&&) noexcept; // constexpr in C++14 + typename tuple_element >::type&& + get(pair&&) noexcept; // constexpr in C++14 template - constexpr T1& get(std::pair&) noexcept; // C++14 + constexpr T1& get(pair&) noexcept; // C++14 template - constexpr T1 const& get(std::pair const &) noexcept; // C++14 + constexpr T1 const& get(pair const &) noexcept; // C++14 template - constexpr T1&& get(std::pair&&) noexcept; // C++14 + constexpr T1&& get(pair&&) noexcept; // C++14 // C++14 diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp index 7b1ff8bb183d..f3f8f2b109d5 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp @@ -28,7 +28,14 @@ void test() static_assert((std::is_same::type, const U>::value), ""); static_assert((std::is_same::type, volatile U>::value), ""); static_assert((std::is_same::type, const volatile U>::value), ""); +#if _LIBCPP_STD_VER > 11 + static_assert((std::is_same, U>::value), ""); + static_assert((std::is_same, const U>::value), ""); + static_assert((std::is_same, volatile U>::value), ""); + static_assert((std::is_same, const volatile U>::value), ""); +#endif } + int main() { test, 0, int>(); diff --git a/libcxx/www/cxx1y_status.html b/libcxx/www/cxx1y_status.html index c698463a82bd..d1632c50a6f7 100644 --- a/libcxx/www/cxx1y_status.html +++ b/libcxx/www/cxx1y_status.html @@ -100,7 +100,7 @@ 3924LWGDiscouraging rand() in C++14Issaquah - 3887LWGConsistent Metafunction AliasesIssaquah + 3887LWGConsistent Metafunction AliasesIssaquahComplete