Skip to content

Less redundant 'typename' in type-id-only contexts #5212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4256,7 +4256,7 @@
typedef T TT;
};

template <class U, class V = typename U::TT>
template <class U, class V = U::TT>
class D : public U { };

D <C<B> >* d; // access error, \tcode{C::TT} is protected
Expand Down
78 changes: 39 additions & 39 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3355,7 +3355,7 @@

\begin{codeblock}
template<class InputIterator>
using @\placeholdernc{iter-value-type}@ = typename iterator_traits<InputIterator>::value_type; // \expos
using @\placeholdernc{iter-value-type}@ = iterator_traits<InputIterator>::value_type; // \expos
\end{codeblock}

\rSec2[array.syn]{Header \tcode{<array>} synopsis}
Expand Down Expand Up @@ -3905,8 +3905,8 @@
// types
using value_type = T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{deque::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -4332,8 +4332,8 @@
// types
using value_type = T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{forward_list::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -5133,8 +5133,8 @@
// types
using value_type = T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{list::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -5841,8 +5841,8 @@
// types
using value_type = T;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{vector::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -6548,13 +6548,13 @@
\begin{codeblock}
template<class InputIterator>
using @\placeholder{iter-value-type}@ =
typename iterator_traits<InputIterator>::value_type; // \expos
iterator_traits<InputIterator>::value_type; // \expos
template<class InputIterator>
using @\placeholder{iter-key-type}@ = remove_const_t<
typename iterator_traits<InputIterator>::value_type::first_type>; // \expos
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://wg21.link/p2165r3 will get rid of the other typenames in this code block.

template<class InputIterator>
using @\placeholder{iter-mapped-type}@ =
typename iterator_traits<InputIterator>::value_type::second_type; // \expos
iterator_traits<InputIterator>::value_type::second_type; // \expos
template<class InputIterator>
using @\placeholder{iter-to-alloc-type}@ = pair<
add_const_t<typename iterator_traits<InputIterator>::value_type::first_type>,
Expand Down Expand Up @@ -6740,8 +6740,8 @@
using value_type = pair<const Key, T>;
using key_compare = Compare;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{map::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -7288,8 +7288,8 @@
using value_type = pair<const Key, T>;
using key_compare = Compare;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{multimap::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -7604,8 +7604,8 @@
using value_type = Key;
using value_compare = Compare;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{set::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -7881,8 +7881,8 @@
using value_type = Key;
using value_compare = Compare;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{multiset::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -8296,8 +8296,8 @@
using hasher = Hash;
using key_equal = Pred;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{unordered_map::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -8894,8 +8894,8 @@
using hasher = Hash;
using key_equal = Pred;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{unordered_multimap::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -9262,8 +9262,8 @@
using hasher = Hash;
using key_equal = Pred;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{unordered_set::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -9590,8 +9590,8 @@
using hasher = Hash;
using key_equal = Pred;
using allocator_type = Allocator;
using pointer = typename allocator_traits<Allocator>::pointer;
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
using pointer = allocator_traits<Allocator>::pointer;
using const_pointer = allocator_traits<Allocator>::const_pointer;
using reference = value_type&;
using const_reference = const value_type&;
using size_type = @\impdefx{type of \tcode{unordered_multiset::size_type}}@; // see \ref{container.requirements}
Expand Down Expand Up @@ -10016,10 +10016,10 @@
template<class T, class Container = deque<T>>
class queue {
public:
using value_type = typename Container::value_type;
using reference = typename Container::reference;
using const_reference = typename Container::const_reference;
using size_type = typename Container::size_type;
using value_type = Container::value_type;
using reference = Container::reference;
using const_reference = Container::const_reference;
using size_type = Container::size_type;
using container_type = Container;

protected:
Expand Down Expand Up @@ -10327,10 +10327,10 @@
class Compare = less<typename Container::value_type>>
class priority_queue {
public:
using value_type = typename Container::value_type;
using reference = typename Container::reference;
using const_reference = typename Container::const_reference;
using size_type = typename Container::size_type;
using value_type = Container::value_type;
using reference = Container::reference;
using const_reference = Container::const_reference;
using size_type = Container::size_type;
using container_type = Container;
using value_compare = Compare;

Expand Down Expand Up @@ -10745,10 +10745,10 @@
template<class T, class Container = deque<T>>
class stack {
public:
using value_type = typename Container::value_type;
using reference = typename Container::reference;
using const_reference = typename Container::const_reference;
using size_type = typename Container::size_type;
using value_type = Container::value_type;
using reference = Container::reference;
using const_reference = Container::const_reference;
using size_type = Container::size_type;
using container_type = Container;

protected:
Expand Down
12 changes: 6 additions & 6 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2065,8 +2065,8 @@
public:
using byte_string = basic_string<char, char_traits<char>, ByteAlloc>;
using wide_string = basic_string<Elem, char_traits<Elem>, WideAlloc>;
using state_type = typename Codecvt::state_type;
using int_type = typename wide_string::traits_type::int_type;
using state_type = Codecvt::state_type;
using int_type = wide_string::traits_type::int_type;

wstring_convert() : wstring_convert(new Codecvt) {}
explicit wstring_convert(Codecvt* pcvt);
Expand Down Expand Up @@ -2186,7 +2186,7 @@

\indexlibrarymember{int_type}{wstring_convert}%
\begin{itemdecl}
using int_type = typename wide_string::traits_type::int_type;
using int_type = wide_string::traits_type::int_type;
\end{itemdecl}

\begin{itemdescr}
Expand All @@ -2207,7 +2207,7 @@

\indexlibrarymember{state_type}{wstring_convert}%
\begin{itemdecl}
using state_type = typename Codecvt::state_type;
using state_type = Codecvt::state_type;
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -2318,7 +2318,7 @@
template<class Codecvt, class Elem = wchar_t, class Tr = char_traits<Elem>>
class wbuffer_convert : public basic_streambuf<Elem, Tr> {
public:
using state_type = typename Codecvt::state_type;
using state_type = Codecvt::state_type;

wbuffer_convert() : wbuffer_convert(nullptr) {}
explicit wbuffer_convert(streambuf* bytebuf,
Expand Down Expand Up @@ -2401,7 +2401,7 @@

\indexlibrarymember{state_type}{wbuffer_convert}%
\begin{itemdecl}
using state_type = typename Codecvt::state_type;
using state_type = Codecvt::state_type;
\end{itemdecl}

\begin{itemdescr}
Expand Down
Loading