Usermode/libc++ - Debug in cxa code, list emplace and iterators, general STL fixes
[tpg/acess2.git] / Usermode / Libraries / libc++.so_src / include_exp / utility
1 /*
2  * Acess2 C++ Library
3  * - By John Hodge (thePowersGang)
4  *
5  * string (header)
6  * - C++'s String type
7  */
8 #ifndef _LIBCXX_UTILITY_
9 #define _LIBCXX_UTILITY_
10
11 #include "_libcxx_helpers.h"
12 #include "type_traits"
13
14 namespace std {
15
16 template <class T1, class T2>
17 class pair
18 {
19 public:
20         typedef T1      first_type;
21         typedef T2      second_type;
22         
23         first_type      first;
24         second_type     second;
25         
26         pair()
27         {
28         }
29         template <class U, class V>
30         pair(const pair<U,V>& pr):
31                 first (pr.first),
32                 second(pr.second)
33         {
34         }
35         pair(const first_type& a, const second_type& b):
36                 first (a),
37                 second(b)
38         {
39         }
40         // operator = is implicit
41 };
42
43 template <class T1, class T2>   
44 bool operator== (const pair<T1,T2>& lhs, const pair<T1,T2>& rhs) {
45         return lhs.first == rhs.first && lhs.second == rhs.second;
46 }
47 template <class T1, class T2>   
48 bool operator!= (const pair<T1,T2>& lhs, const pair<T1,T2>& rhs) {
49         return !(lhs == rhs);
50 }
51
52 #if _CXX11_AVAIL
53 template <class T>
54 T&& forward(typename remove_reference<T>::type& arg) noexcept {
55         return static_cast<decltype(arg)&&>(arg);
56 }
57 template <class T>
58 T&& forward(typename remove_reference<T>::type&& arg) noexcept {
59         return static_cast<decltype(arg)&&>(arg);
60 }
61 #endif
62
63 };      // namespace std
64
65 #endif
66
67 // vim: ft=cpp
68

UCC git Repository :: git.ucc.asn.au