Skip to content

Commit

Permalink
[pair.astuple, tuple.helper] Fix inconsistent class key in tuple_size…
Browse files Browse the repository at this point in the history
…/tuple_element. (#2679)

It was declared as a struct and specializations were classes.
  • Loading branch information
hanickadot authored and tkoeppe committed Feb 22, 2019
1 parent 102a791 commit 6f34b05
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3088,8 +3088,8 @@
constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y)));

// \ref{array.tuple}, tuple interface to class template \tcode{array}
template<class T> class tuple_size;
template<size_t I, class T> class tuple_element;
template<class T> struct tuple_size;
template<size_t I, class T> struct tuple_element;
template<class T, size_t N>
struct tuple_size<array<T, N>>;
template<size_t I, class T, size_t N>
Expand Down
41 changes: 20 additions & 21 deletions source/utilities.tex
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@
constexpr @\seebelow@ make_pair(T1&&, T2&&);

// \ref{pair.astuple}, tuple-like access to pair
template<class T> class tuple_size;
template<size_t I, class T> class tuple_element;
template<class T> struct tuple_size;
template<size_t I, class T> struct tuple_element;

template<class T1, class T2> struct tuple_size<pair<T1, T2>>;
template<size_t I, class T1, class T2> struct tuple_element<I, pair<T1, T2>>;
Expand Down Expand Up @@ -1018,20 +1018,20 @@
constexpr T make_from_tuple(Tuple&& t);

// \ref{tuple.helper}, tuple helper classes
template<class T> class tuple_size; // not defined
template<class T> class tuple_size<const T>;
template<class T> class tuple_size<volatile T>;
template<class T> class tuple_size<const volatile T>;
template<class T> struct tuple_size; // not defined
template<class T> struct tuple_size<const T>;
template<class T> struct tuple_size<volatile T>;
template<class T> struct tuple_size<const volatile T>;

template<class... Types> class tuple_size<tuple<Types...>>;
template<class... Types> struct tuple_size<tuple<Types...>>;

template<size_t I, class T> class tuple_element; // not defined
template<size_t I, class T> class tuple_element<I, const T>;
template<size_t I, class T> class tuple_element<I, volatile T>;
template<size_t I, class T> class tuple_element<I, const volatile T>;
template<size_t I, class T> struct tuple_element; // not defined

This comment has been minimized.

Copy link
@tkoeppe

tkoeppe Feb 22, 2019

Contributor

Oh, eek, we need to revise the comment column here... oh well.

This comment has been minimized.

Copy link
@tkoeppe

tkoeppe Feb 22, 2019

Contributor

Hm, by sheer force of luck, the column had actually been wrong before this change and is now good. Phew.

This comment has been minimized.

Copy link
@tkoeppe

tkoeppe Feb 22, 2019

Contributor

A synergy with e543af3... never mind, as you were.

template<size_t I, class T> struct tuple_element<I, const T>;
template<size_t I, class T> struct tuple_element<I, volatile T>;
template<size_t I, class T> struct tuple_element<I, const volatile T>;

template<size_t I, class... Types>
class tuple_element<I, tuple<Types...>>;
struct tuple_element<I, tuple<Types...>>;

template<size_t I, class T>
using tuple_element_t = typename tuple_element<I, T>::type;
Expand Down Expand Up @@ -1794,14 +1794,13 @@
\indexlibrary{\idxcode{tuple_size}}%
\begin{itemdecl}
template<class... Types>
class tuple_size<tuple<Types...>> : public integral_constant<size_t, sizeof...(Types)> { };
struct tuple_size<tuple<Types...>> : public integral_constant<size_t, sizeof...(Types)> { };
\end{itemdecl}

\indexlibrary{\idxcode{tuple_element}}%
\begin{itemdecl}
template<size_t I, class... Types>
class tuple_element<I, tuple<Types...>> {
public:
struct tuple_element<I, tuple<Types...>> {
using type = TI;
};
\end{itemdecl}
Expand All @@ -1819,9 +1818,9 @@

\indexlibrary{\idxcode{tuple_size}}%
\begin{itemdecl}
template<class T> class tuple_size<const T>;
template<class T> class tuple_size<volatile T>;
template<class T> class tuple_size<const volatile T>;
template<class T> struct tuple_size<const T>;
template<class T> struct tuple_size<volatile T>;
template<class T> struct tuple_size<const volatile T>;
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -1857,9 +1856,9 @@

\indexlibrary{\idxcode{tuple_element}}%
\begin{itemdecl}
template<size_t I, class T> class tuple_element<I, const T>;
template<size_t I, class T> class tuple_element<I, volatile T>;
template<size_t I, class T> class tuple_element<I, const volatile T>;
template<size_t I, class T> struct tuple_element<I, const T>;
template<size_t I, class T> struct tuple_element<I, volatile T>;
template<size_t I, class T> struct tuple_element<I, const volatile T>;
\end{itemdecl}

\begin{itemdescr}
Expand Down

0 comments on commit 6f34b05

Please sign in to comment.