00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _TR1_TUPLE
00037 #define _TR1_TUPLE 1
00038
00039 #include <tr1/utility>
00040 #include <tr1/ref_fwd.h>
00041
00042 namespace std
00043 {
00044 _GLIBCXX_BEGIN_NAMESPACE(tr1)
00045
00046
00047
00048 struct _NullClass { };
00049
00050
00051 template<int __i, typename _Tp>
00052 struct tuple_element;
00053
00054
00055 template<typename _Tp>
00056 struct tuple_size;
00057
00058
00059 template<typename _Tp>
00060 struct __add_c_ref
00061 { typedef const _Tp& type; };
00062
00063 template<typename _Tp>
00064 struct __add_c_ref<_Tp&>
00065 { typedef _Tp& type; };
00066
00067
00068 template<typename _Tp>
00069 struct __add_ref
00070 { typedef _Tp& type; };
00071
00072 template<typename _Tp>
00073 struct __add_ref<_Tp&>
00074 { typedef _Tp& type; };
00075
00076
00077 template<int __i, typename _Tp>
00078 struct __get_helper;
00079
00080
00081
00082
00083
00084 template<int __check_equal_size, int __i, int __j, typename _Tp, typename _Up>
00085 struct __tuple_compare;
00086
00087
00088 template<typename _Tp>
00089 struct __strip_reference_wrapper
00090 {
00091 typedef _Tp __type;
00092 };
00093
00094 template<typename _Tp>
00095 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
00096 {
00097 typedef _Tp& __type;
00098 };
00099
00100 template<typename _Tp>
00101 struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
00102 {
00103 typedef _Tp& __type;
00104 };
00105
00106 #include "tuple_defs.h"
00107
00108 template<int __i, int __j, typename _Tp, typename _Up>
00109 struct __tuple_compare<0, __i, __j, _Tp, _Up>
00110 {
00111 static bool __eq(const _Tp& __t, const _Up& __u)
00112 {
00113 return get<__i>(__t) == get<__i>(__u) &&
00114 __tuple_compare<0, __i+1, __j, _Tp, _Up>::__eq(__t, __u);
00115 }
00116 static bool __less(const _Tp& __t, const _Up& __u)
00117 {
00118 return (get<__i>(__t) < get<__i>(__u)) || !(get<__i>(__u) < get<__i>(__t)) &&
00119 __tuple_compare<0, __i+1, __j, _Tp, _Up>::__less(__t, __u);
00120 }
00121 };
00122
00123 template<int __i, typename _Tp, typename _Up>
00124 struct __tuple_compare<0, __i, __i, _Tp, _Up>
00125 {
00126 static bool __eq(const _Tp&, const _Up&)
00127 { return true; }
00128 static bool __less(const _Tp&, const _Up&)
00129 { return false; }
00130 };
00131
00132
00133
00134 struct swallow_assign
00135 {
00136 template<class T>
00137 swallow_assign&
00138 operator=(const T&)
00139 { return *this; }
00140 };
00141
00142
00143 namespace
00144 {
00145 swallow_assign ignore;
00146 };
00147
00148 _GLIBCXX_END_NAMESPACE
00149 }
00150
00151 #define _GLIBCXX_CAT(x,y) _GLIBCXX_CAT2(x,y)
00152 #define _GLIBCXX_CAT2(x,y) x##y
00153 #define _SHORT_REPEAT
00154 #define _GLIBCXX_REPEAT_HEADER <tr1/tuple_iterate.h>
00155 #include <tr1/repeat.h>
00156 #undef _GLIBCXX_REPEAT_HEADER
00157 #undef _SHORT_REPEAT
00158
00159 #include <tr1/functional>
00160
00161 #endif