Debian Codegraph @

headers/utility

raw
1 /* Copyright (C) 2015 Povilas Kanapickas <[email protected]>
2
3 This file is part of cppreference-doc
4
5 This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
6 Unported License. To view a copy of this license, visit
7 http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
8 Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
9
10 Permission is granted to copy, distribute and/or modify this document
11 under the terms of the GNU Free Documentation License, Version 1.3 or
12 any later version published by the Free Software Foundation; with no
13 Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
14 */
15
16 #ifndef CPPREFERENCE_UTILITY_H
17 #define CPPREFERENCE_UTILITY_H
18
19 #if CPPREFERENCE_STDVER>= 2011
20 #include <initializer_list>
21 #endif
22
23 namespace std {
24
25 #if CPPREFERENCE_STDVER>= 2011
26 // defined in <algorithm> pre C++11
27 template<class T>
28 void swap(T& a, T& b);
29
30 template<class T2, size_t N>
31 void swap(T2(&a)[N], T2(&b)[N]);
32 #endif
33
34 namespace rel_ops {
35 template<class T>
36 bool operator!=(const T& lhs, const T& rhs);
37 template<class T>
38 bool operator>(const T& lhs, const T& rhs);
39 template<class T>
40 bool operator<=(const T& lhs, const T& rhs);
41 template<class T>
42 bool operator>=(const T& lhs, const T& rhs);
43 } // namespace rel_ops
44
45 #if CPPREFERENCE_STDVER>= 2014
46 template<class T, class U = T>
47 T exchange(T& obj, U && new_value);
48 #endif
49
50 #if CPPREFERENCE_STDVER>= 2011
51 template<class T>
52 T&& forward(typename std::remove_reference<T>::type& t);
53
54 template<class T>
55 T&& forward(typename std::remove_reference<T>::type&& t);
56
57 template<class T>
58 typename T&& move(T&& t); // SIMPLIFIED: return type
59
60 template<class T>
61 typename T&& move_if_noexcept(T&& t); // SIMPLIFIED: return type
62
63 template<class T>
64 T declval(); // SIMPLIFIED: return type
65
66 struct piecewise_construct_t { };
67 constexpr piecewise_construct_t piecewise_construct;
68 #endif
69
70 template <
71 class T1,
72 class T2
73 > struct pair {
74 typedef T1 first_type;
75 typedef T2 second_type;
76 T1 first;
77 T2 second;
78
79 pair();
80 pair(const T1& x, const T2& y);
81
82 template<class U1, class U2>
83 pair(const pair<U1, U2>& p);
84
85 #if CPPREFERENCE_STDVER>= 2011
86 template<class U1, class U2>
87 pair(U1&& x, U2&& y);
88
89 template<class U1, class U2>
90 pair(pair<U1, U2>&& p);
91
92 template<class... Args1, class... Args2>
93 pair(std::piecewise_construct_t,
94 std::tuple<Args1...> first_args,
95 std::tuple<Args2...> second_args);
96 #endif
97
98 pair(const pair& p);
99 pair(pair&& p);
100
101 pair& operator=(const pair& other);
102
103 template<class U1, class U2>
104 pair& operator=(const pair<U1, U2>& other);
105
106 #if CPPREFERENCE_STDVER>= 2011
107 pair& operator=(pair&& other);
108
109 template<class U1, class U2>
110 pair& operator=(pair<U1, U2>&& other);
111 #endif
112
113 void swap(pair& other);
114 };
115
116 template<class T1, class T2>
117 bool operator==(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs);
118 template<class T1, class T2>
119 bool operator!=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs);
120 template<class T1, class T2>
121 bool operator<(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs);
122 template<class T1, class T2>
123 bool operator<=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs);
124 template<class T1, class T2>
125 bool operator>(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs);
126 template<class T1, class T2>
127 bool operator>=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs);
128
129 #if CPPREFERENCE_STDVER <2011
130 template<class T1, class T2>
131 std::pair<T1, T2> make_pair(T1 t, T2 u);
132 #else
133 template<class T1, class T2>
134 std::pair<T1, T2> make_pair(T1&& t, T2&& u);
135 #endif
136
137 template<class T1, class T2>
138 void swap(pair<T1, T2>& lhs, pair<T1, T2>& rhs);
139
140 #if CPPREFERENCE_STDVER>= 2011
141 template<size_t N, class T1, class T2>
142 typename std::tuple_element<I, std::pair<T1, T2>>::type&
143 get(pair<T1, T2>& p);
144 // SIMPLIFIED: additional overloads omitted
145 #endif
146
147 } // namespace std
148
149 #endif // CPPREFERENCE_UTILITY_H