Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygen_pair.h
Go to the documentation of this file.
00001 /* 00002 * 00003 * Copyright (c) 1994 00004 * Hewlett-Packard Company 00005 * 00006 * Copyright (c) 1996,1997 00007 * Silicon Graphics Computer Systems, Inc. 00008 * 00009 * Copyright (c) 1997 00010 * Moscow Center for SPARC Technology 00011 * 00012 * Copyright (c) 1999 00013 * Boris Fomitchev 00014 * 00015 * This material is provided "as is", with absolutely no warranty expressed 00016 * or implied. Any use is at your own risk. 00017 * 00018 * Permission to use or copy this software for any purpose is hereby granted 00019 * without fee, provided the above notices are retained on all copies. 00020 * Permission to modify the code and to distribute modified code is granted, 00021 * provided the above notices are retained, and a notice that the code was 00022 * modified is included with the above copyright notice. 00023 * 00024 */ 00025 00026 00027 /* NOTE: This is an internal header file, included by other STL headers. 00028 * You should not attempt to use it directly. 00029 */ 00030 00031 #ifndef _STLP_INTERNAL_PAIR_H 00032 #define _STLP_INTERNAL_PAIR_H 00033 00034 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) 00035 # ifndef _STLP_TYPE_TRAITS_H 00036 # include <stl/type_traits.h> 00037 # endif 00038 00039 # if !defined (_STLP_MOVE_CONSTRUCT_FWK_H) && !defined (_STLP_NO_MOVE_SEMANTIC) 00040 # include <stl/_move_construct_fwk.h> 00041 # endif 00042 #endif 00043 00044 _STLP_BEGIN_NAMESPACE 00045 00046 template <class _T1, class _T2> 00047 struct pair { 00048 typedef _T1 first_type; 00049 typedef _T2 second_type; 00050 00051 _T1 first; 00052 _T2 second; 00053 #if defined (_STLP_CONST_CONSTRUCTOR_BUG) 00054 pair() {} 00055 #else 00056 pair() : first(_T1()), second(_T2()) {} 00057 #endif 00058 pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) {} 00059 00060 #if defined (_STLP_MEMBER_TEMPLATES) 00061 template <class _U1, class _U2> 00062 pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) {} 00063 00064 pair(const pair<_T1,_T2>& __o) : first(__o.first), second(__o.second) {} 00065 #endif 00066 00067 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_NO_MOVE_SEMANTIC) 00068 pair(__move_source<pair<_T1, _T2> > src) : first(_STLP_PRIV _AsMoveSource(src.get().first)), 00069 second(_STLP_PRIV _AsMoveSource(src.get().second)) 00070 {} 00071 #endif 00072 00073 __TRIVIAL_DESTRUCTOR(pair) 00074 }; 00075 00076 template <class _T1, class _T2> 00077 inline bool _STLP_CALL operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) 00078 { return __x.first == __y.first && __x.second == __y.second; } 00079 00080 template <class _T1, class _T2> 00081 inline bool _STLP_CALL operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { 00082 return __x.first < __y.first || 00083 (!(__y.first < __x.first) && __x.second < __y.second); 00084 } 00085 00086 #if defined (_STLP_USE_SEPARATE_RELOPS_NAMESPACE) 00087 template <class _T1, class _T2> 00088 inline bool _STLP_CALL operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) 00089 { return !(__x == __y); } 00090 00091 template <class _T1, class _T2> 00092 inline bool _STLP_CALL operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) 00093 { return __y < __x; } 00094 00095 template <class _T1, class _T2> 00096 inline bool _STLP_CALL operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) 00097 { return !(__y < __x); } 00098 00099 template <class _T1, class _T2> 00100 inline bool _STLP_CALL operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) 00101 { return !(__x < __y); } 00102 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */ 00103 00104 #if defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) && !defined (_STLP_NO_EXTENSIONS) 00105 template <class _T1, class _T2, int _Sz> 00106 inline pair<_T1, _T2 const*> make_pair(_T1 const& __x, 00107 _T2 const (&__y)[_Sz]) 00108 { return pair<_T1, _T2 const*>(__x, static_cast<_T2 const*>(__y)); } 00109 00110 template <class _T1, class _T2, int _Sz> 00111 inline pair<_T1 const*, _T2> make_pair(_T1 const (&__x)[_Sz], 00112 _T2 const& __y) 00113 { return pair<_T1 const*, _T2>(static_cast<_T1 const*>(__x), __y); } 00114 00115 template <class _T1, class _T2, int _Sz1, int _Sz2> 00116 inline pair<_T1 const*, _T2 const*> make_pair(_T1 const (&__x)[_Sz1], 00117 _T2 const (&__y)[_Sz2]) { 00118 return pair<_T1 const*, _T2 const*>(static_cast<_T1 const*>(__x), 00119 static_cast<_T2 const*>(__y)); 00120 } 00121 #endif 00122 00123 template <class _T1, class _T2> 00124 inline pair<_T1, _T2> _STLP_CALL make_pair(_T1 __x, _T2 __y) 00125 { return pair<_T1, _T2>(__x, __y); } 00126 00127 _STLP_END_NAMESPACE 00128 00129 #if defined (_STLP_USE_NAMESPACES) || !defined (_STLP_USE_SEPARATE_RELOPS_NAMESPACE) 00130 _STLP_BEGIN_RELOPS_NAMESPACE 00131 00132 template <class _Tp> 00133 inline bool _STLP_CALL operator!=(const _Tp& __x, const _Tp& __y) 00134 { return !(__x == __y); } 00135 00136 template <class _Tp> 00137 inline bool _STLP_CALL operator>(const _Tp& __x, const _Tp& __y) 00138 { return __y < __x; } 00139 00140 template <class _Tp> 00141 inline bool _STLP_CALL operator<=(const _Tp& __x, const _Tp& __y) 00142 { return !(__y < __x); } 00143 00144 template <class _Tp> 00145 inline bool _STLP_CALL operator>=(const _Tp& __x, const _Tp& __y) 00146 { return !(__x < __y); } 00147 00148 _STLP_END_RELOPS_NAMESPACE 00149 #endif 00150 00151 #if defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) 00152 _STLP_BEGIN_NAMESPACE 00153 00154 template <class _T1, class _T2> 00155 struct __type_traits<pair<_T1, _T2> > { 00156 typedef __type_traits<_T1> _T1Traits; 00157 typedef __type_traits<_T2> _T2Traits; 00158 typedef typename _Land2<typename _T1Traits::has_trivial_default_constructor, 00159 typename _T2Traits::has_trivial_default_constructor>::_Ret has_trivial_default_constructor; 00160 typedef typename _Land2<typename _T1Traits::has_trivial_copy_constructor, 00161 typename _T2Traits::has_trivial_copy_constructor>::_Ret has_trivial_copy_constructor; 00162 typedef typename _Land2<typename _T1Traits::has_trivial_assignment_operator, 00163 typename _T2Traits::has_trivial_assignment_operator>::_Ret has_trivial_assignment_operator; 00164 typedef typename _Land2<typename _T1Traits::has_trivial_destructor, 00165 typename _T2Traits::has_trivial_destructor>::_Ret has_trivial_destructor; 00166 typedef __false_type is_POD_type; 00167 }; 00168 00169 # if !defined (_STLP_NO_MOVE_SEMANTIC) 00170 template <class _T1, class _T2> 00171 struct __move_traits<pair<_T1, _T2> > 00172 : _STLP_PRIV __move_traits_help1<_T1, _T2> {}; 00173 # endif 00174 00175 _STLP_END_NAMESPACE 00176 #endif 00177 00178 #endif /* _STLP_INTERNAL_PAIR_H */ 00179 00180 // Local Variables: 00181 // mode:C++ 00182 // End: Generated on Sun May 27 2012 04:29:20 for ReactOS by
1.7.6.1
|