Index: include/__tuple =================================================================== --- include/__tuple +++ include/__tuple @@ -53,26 +53,23 @@ template struct _LIBCPP_TEMPLATE_VIS tuple_size : public tuple_size<_Tp> {}; #endif -template class _LIBCPP_TEMPLATE_VIS tuple_element; +template struct _LIBCPP_TEMPLATE_VIS tuple_element; template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> { -public: typedef typename add_const::type>::type type; }; template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> { -public: typedef typename add_volatile::type>::type type; }; template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> { -public: typedef typename add_cv::type>::type type; }; @@ -281,9 +278,8 @@ #endif template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> { -public: static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range"); typedef __type_pack_element<_Ip, _Types...> type; }; @@ -456,9 +452,8 @@ template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > { -public: typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; }; Index: include/array =================================================================== --- include/array +++ include/array @@ -91,7 +91,7 @@ void swap(array& x, array& y) noexcept(noexcept(x.swap(y))); // C++17 template struct tuple_size; -template class tuple_element; +template struct tuple_element; template struct tuple_size>; template struct tuple_element>; template T& get(array&) noexcept; // constexpr in C++14 @@ -433,10 +433,9 @@ : public integral_constant {}; template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> > +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, array<_Tp, _Size> > { static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::array)"); -public: typedef _Tp type; }; Index: include/span =================================================================== --- include/span +++ include/span @@ -531,11 +531,10 @@ template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, span<_Tp, _Size>> +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, span<_Tp, _Size>> { static_assert( dynamic_extent != _Size, "std::tuple_element<> not supported for std::span"); static_assert(_Ip < _Size, "Index out of bounds in std::tuple_element<> (std::span)"); -public: typedef _Tp type; }; Index: include/tuple =================================================================== --- include/tuple +++ include/tuple @@ -87,8 +87,8 @@ template struct tuple_size>; template inline constexpr size_t tuple_size_v = tuple_size::value; // C++17 -template class tuple_element; // undefined -template class tuple_element>; +template struct tuple_element; // undefined +template struct tuple_element>; template using tuple_element_t = typename tuple_element ::type; // C++14 Index: include/utility =================================================================== --- include/utility +++ include/utility @@ -103,7 +103,7 @@ inline constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); template struct tuple_size; -template class tuple_element; +template struct tuple_element; template struct tuple_size >; template struct tuple_element<0, pair >; @@ -687,22 +687,20 @@ : public integral_constant {}; template -class _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> > +struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, pair<_T1, _T2> > { static_assert(_Ip < 2, "Index out of bounds in std::tuple_element>"); }; template -class _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> > +struct _LIBCPP_TEMPLATE_VIS tuple_element<0, pair<_T1, _T2> > { -public: typedef _T1 type; }; template -class _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> > +struct _LIBCPP_TEMPLATE_VIS tuple_element<1, pair<_T1, _T2> > { -public: typedef _T2 type; }; Index: test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp =================================================================== --- test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp +++ test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple.include.array.pass.cpp @@ -11,9 +11,8 @@ // template class tuple; // template -// class tuple_element > +// struct tuple_element > // { -// public: // typedef Ti type; // }; // Index: test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp =================================================================== --- test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp +++ test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp @@ -11,9 +11,8 @@ // template class tuple; // template -// class tuple_element > +// struct tuple_element > // { -// public: // typedef Ti type; // }; Index: test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp =================================================================== --- test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp +++ test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.pass.cpp @@ -11,9 +11,8 @@ // template class tuple; // template -// class tuple_element > +// struct tuple_element > // { -// public: // typedef Ti type; // }; Index: test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp =================================================================== --- test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp +++ test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp @@ -116,8 +116,7 @@ int get(Test const&) { static_assert(N == 0, ""); return -1; } template <> -class std::tuple_element<0, Test> { -public: +struct std::tuple_element<0, Test> { typedef int type; };