Skip to content

[18-30] Replace typedefs with alias #704

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

Merged
merged 1 commit into from
Jun 8, 2016
Merged
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
423 changes: 212 additions & 211 deletions source/containers.tex

Large diffs are not rendered by default.

173 changes: 87 additions & 86 deletions source/future.tex
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
virtual streambuf* setbuf(char* s, streamsize n);

private:
typedef T1 strstate; // \expos
static const strstate allocated; // \expos
using strstate = T1; // \expos
static const strstate allocated; // \expos
static const strstate constant; // \expos
static const strstate dynamic; // \expos
static const strstate frozen; // \expos
Expand Down Expand Up @@ -996,10 +996,10 @@
: public basic_iostream<char> {
public:
// Types
typedef char char_type;
typedef typename char_traits<char>::int_type int_type;
typedef typename char_traits<char>::pos_type pos_type;
typedef typename char_traits<char>::off_type off_type;
using char_type = char;
using int_type = char_traits<char>::int_type;
using pos_type = char_traits<char>::pos_type;
using off_type = char_traits<char>::off_type;

// constructors/destructor
strstream();
Expand Down Expand Up @@ -1150,7 +1150,7 @@

\indexlibrary{\idxcode{unexpected_handler}}%
\begin{itemdecl}
typedef void (*unexpected_handler)();
using unexpected_handler = void (*)();
\end{itemdecl}

\begin{itemdescr}
Expand Down Expand Up @@ -1271,7 +1271,7 @@
To enable old function adaptors to manipulate function objects
that take one or two arguments,
many of the function objects in this standard
correspondingly provide typedefs
correspondingly provide \grammarterm{typedef-name}{s}
\tcode{argument_type} and \tcode{result_type}
for function objects that take one argument and
\tcode{first_argument_type}, \tcode{second_argument_type}, and \tcode{result_type}
Expand All @@ -1287,147 +1287,147 @@
\begin{codeblock}
namespace std {
template<class T> struct owner_less<shared_ptr<T> > {
typedef bool result_type;
typedef shared_ptr<T> first_argument_type;
typedef shared_ptr<T> second_argument_type;
using result_type = bool;
using first_argument_type = shared_ptr<T>;
using second_argument_type = shared_ptr<T>;
};

template<class T> struct owner_less<weak_ptr<T> > {
typedef bool result_type;
typedef weak_ptr<T> first_argument_type;
typedef weak_ptr<T> second_argument_type;
using result_type = bool;
using first_argument_type = weak_ptr<T>;
using second_argument_type = weak_ptr<T>;
};

template <class T> class reference_wrapper {
public :
typedef @\seebelow@ result_type; // not always defined
typedef @\seebelow@ argument_type; // not always defined
typedef @\seebelow@ first_argument_type; // not always defined
typedef @\seebelow@ second_argument_type; // not always defined
using result_type = @\seebelow@; // not always defined
using argument_type = @\seebelow@; // not always defined
using first_argument_type = @\seebelow@; // not always defined
using second_argument_type = @\seebelow@; // not always defined
};

template <class T> struct plus {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct minus {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct multiplies {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct divides {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct modulus {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct negate {
typedef T argument_type;
typedef T result_type;
using argument_type = T;
using result_type = T;
};

template <class T> struct equal_to {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct not_equal_to {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct greater {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct less {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct greater_equal {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct less_equal {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct logical_and {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct logical_or {
typedef T first_argument_type;
typedef T second_argument_type;
typedef bool result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = bool;
};

template <class T> struct logical_not {
typedef T argument_type;
typedef bool result_type;
using argument_type = T;
using result_type = bool;
};

template <class T> struct bit_and {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct bit_or {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct bit_xor {
typedef T first_argument_type;
typedef T second_argument_type;
typedef T result_type;
using first_argument_type = T;
using second_argument_type = T;
using result_type = T;
};

template <class T> struct bit_not {
typedef T argument_type;
typedef T result_type;
using argument_type = T;
using result_type = T;
};

template<class R, class T1>
class function<R(T1)> {
public:
typedef T1 argument_type;
using argument_type = T1;
};

template<class R, class T1, class T2>
class function<R(T1, T2)> {
public:
typedef T1 first_argument_type;
typedef T2 second_argument_type;
using first_argument_type = T1;
using second_argument_type = T2;
};
}
\end{codeblock}
Expand Down Expand Up @@ -1525,17 +1525,17 @@
template <class Key, class T, class Compare, class Allocator>
class map<Key, T, Compare, Allocator>::value_compare {
public:
typedef bool result_type;
typedef value_type first_argument_type;
typedef value_type second_argument_type;
using result_type = bool;
using first_argument_type = value_type;
using second_argument_type = value_type;
};

template <class Key, class T, class Compare, class Allocator>
class multimap<Key, T, Compare, Allocator>::value_compare {
public:
typedef bool result_type;
typedef value_type first_argument_type;
typedef value_type second_argument_type;
using result_type = bool;
using first_argument_type = value_type;
using second_argument_type = value_type;
};
}
\end{codeblock}
Expand Down Expand Up @@ -1568,8 +1568,8 @@
public:
constexpr explicit unary_negate(const Predicate& pred);
constexpr bool operator()(const typename Predicate::argument_type& x) const;
typedef typename Predicate::argument_type argument_type;
typedef bool result_type;
using argument_type = typename Predicate::argument_type;
using result_type = bool;
};
\end{codeblock}

Expand Down Expand Up @@ -1600,9 +1600,10 @@
constexpr explicit binary_negate(const Predicate& pred);
constexpr bool operator()(const typename Predicate::first_argument_type& x,
const typename Predicate::second_argument_type& y) const;
typedef typename Predicate::first_argument_type first_argument_type;
typedef typename Predicate::second_argument_type second_argument_type;
typedef bool result_type;
using first_argument_type = typename Predicate::first_argument_type;
using second_argument_type = typename Predicate::second_argument_type;
using result_type = bool;

};
\end{codeblock}

Expand Down
Loading