From 4ee3998918974120f7850e40ea328b898566e8b6 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sat, 2 Apr 2005 12:56:18 +0000 Subject: [PATCH] tuple_iterate.h (tuple_element): Use new macro _GLIBCXX_T_NUM_ARGS_PLUS_1 because _T is a macro on Darwin. 2005-04-02 Douglas Gregor * include/tr1/tuple_iterate.h (tuple_element): Use new macro _GLIBCXX_T_NUM_ARGS_PLUS_1 because _T is a macro on Darwin. * include/tr1/repeat.h (_GLIBCXX_T_NUM_ARGS_PLUS_1): Define for each iteration. * scripts/gen_includers.h: Define _GLIBCXX_T_NUM_ARGS_PLUS_1 for each iteration. From-SVN: r97438 --- libstdc++-v3/ChangeLog | 9 ++++++++ libstdc++-v3/include/tr1/repeat.h | 22 +++++++++++++++++++ libstdc++-v3/include/tr1/tuple_iterate.h | 28 ++++++++++++------------ libstdc++-v3/scripts/gen_includers.pl | 3 ++- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8c4f0821f561..ee962c961279 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2005-04-02 Douglas Gregor + + * include/tr1/tuple_iterate.h (tuple_element): Use new macro + _GLIBCXX_T_NUM_ARGS_PLUS_1 because _T is a macro on Darwin. + * include/tr1/repeat.h (_GLIBCXX_T_NUM_ARGS_PLUS_1): Define for + each iteration. + * scripts/gen_includers.h: Define _GLIBCXX_T_NUM_ARGS_PLUS_1 for + each iteration. + 2005-04-01 Douglas Gregor * include/tr1/functional (_Maybe_wrap_member_pointer): Wrap up diff --git a/libstdc++-v3/include/tr1/repeat.h b/libstdc++-v3/include/tr1/repeat.h index 1c57b0bd55ea..fa23c0b66b62 100644 --- a/libstdc++-v3/include/tr1/repeat.h +++ b/libstdc++-v3/include/tr1/repeat.h @@ -62,7 +62,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS #define _GLIBCXX_REF_TEMPLATE_ARGS #define _GLIBCXX_NUM_ARGS_PLUS_1 1 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T1 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -114,7 +116,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1& #define _GLIBCXX_NUM_ARGS_PLUS_1 2 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T2 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -166,7 +170,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2& #define _GLIBCXX_NUM_ARGS_PLUS_1 3 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T3 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -218,7 +224,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3& #define _GLIBCXX_NUM_ARGS_PLUS_1 4 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T4 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -270,7 +278,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4& #define _GLIBCXX_NUM_ARGS_PLUS_1 5 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T5 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -322,7 +332,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5& #define _GLIBCXX_NUM_ARGS_PLUS_1 6 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T6 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -374,7 +386,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6& #define _GLIBCXX_NUM_ARGS_PLUS_1 7 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T7 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -426,7 +440,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7& #define _GLIBCXX_NUM_ARGS_PLUS_1 8 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T8 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -478,7 +494,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7), ref(__a8) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7&, _T8& #define _GLIBCXX_NUM_ARGS_PLUS_1 9 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T9 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -530,7 +548,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7), ref(__a8), ref(__a9) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7&, _T8&, _T9& #define _GLIBCXX_NUM_ARGS_PLUS_1 10 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T10 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS @@ -583,7 +603,9 @@ #define _GLIBCXX_REF_WRAP_PARAMS ref(__a1), ref(__a2), ref(__a3), ref(__a4), ref(__a5), ref(__a6), ref(__a7), ref(__a8), ref(__a9), ref(__a10) #define _GLIBCXX_REF_TEMPLATE_ARGS _T1&, _T2&, _T3&, _T4&, _T5&, _T6&, _T7&, _T8&, _T9&, _T10& #define _GLIBCXX_NUM_ARGS_PLUS_1 11 +#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T11 #include _GLIBCXX_REPEAT_HEADER +#undef _GLIBCXX_T_NUM_ARGS_PLUS_1 #undef _GLIBCXX_NUM_ARGS_PLUS_1 #undef _GLIBCXX_REF_TEMPLATE_ARGS #undef _GLIBCXX_REF_WRAP_PARAMS diff --git a/libstdc++-v3/include/tr1/tuple_iterate.h b/libstdc++-v3/include/tr1/tuple_iterate.h index df572764b4d0..23cb01fc923d 100644 --- a/libstdc++-v3/include/tr1/tuple_iterate.h +++ b/libstdc++-v3/include/tr1/tuple_iterate.h @@ -49,7 +49,7 @@ template<_GLIBCXX_TEMPLATE_PARAMS> _GLIBCXX_BIND_MEMBERS public: - tuple() + tuple() { } #if _GLIBCXX_NUM_ARGS == 2 @@ -75,8 +75,8 @@ template tuple& operator=(const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __in) { - _GLIBCXX_TUPLE_ASSIGN - return *this; + _GLIBCXX_TUPLE_ASSIGN + return *this; } tuple(const tuple& __in) : @@ -94,7 +94,7 @@ template operator=(const tuple& __in) { _GLIBCXX_TUPLE_ASSIGN - return *this; + return *this; } template @@ -110,25 +110,25 @@ template template struct __get_helper<_GLIBCXX_NUM_ARGS, _Tp> { - static typename __add_ref::type>::type + static typename __add_ref::type>::type get_value(_Tp& __in) { return __in._GLIBCXX_CAT(_M_arg,_GLIBCXX_NUM_ARGS_PLUS_1); } static typename __add_c_ref::type>::type + _Tp>::type>::type get_value(const _Tp& __in) { return __in._GLIBCXX_CAT(_M_arg,_GLIBCXX_NUM_ARGS_PLUS_1); } }; -/// @brief class tuple_element -template - struct tuple_element<_GLIBCXX_NUM_ARGS, tuple<_T1, _T2, _T3, _T4, - _T5, _T6, _T7, _T8, _T9, + struct tuple_element<_GLIBCXX_NUM_ARGS, tuple<_T1, _T2, _T3, _T4, + _T5, _T6, _T7, _T8, _T9, _T10> > - { typedef _GLIBCXX_CAT(_T,_GLIBCXX_NUM_ARGS_PLUS_1) type; }; + { typedef _GLIBCXX_T_NUM_ARGS_PLUS_1 type; }; #endif #if _GLIBCXX_NUM_ARGS == 0 @@ -145,7 +145,7 @@ tie() template<_GLIBCXX_TEMPLATE_PARAMS> typename __stripped_tuple_type<_GLIBCXX_TEMPLATE_ARGS>::__type make_tuple(_GLIBCXX_PARAMS) - { + { return typename __stripped_tuple_type<_GLIBCXX_TEMPLATE_ARGS>:: __type(_GLIBCXX_ARGS); } diff --git a/libstdc++-v3/scripts/gen_includers.pl b/libstdc++-v3/scripts/gen_includers.pl index 62ab0f2739dc..bfc3a7ec59d7 100644 --- a/libstdc++-v3/scripts/gen_includers.pl +++ b/libstdc++-v3/scripts/gen_includers.pl @@ -70,6 +70,7 @@ for ($num_args = 2; $num_args <= $max; ++$num_args) { print "#define _GLIBCXX_REF_WRAP_PARAMS $ref_wrap_params\n"; print "#define _GLIBCXX_REF_TEMPLATE_ARGS $ref_template_args\n"; print "#define _GLIBCXX_NUM_ARGS_PLUS_1 $next_args\n"; + print "#define _GLIBCXX_T_NUM_ARGS_PLUS_1 _T$next_args\n"; if ($num_args == $max) { print "#define _GLIBCXX_LAST_INCLUDE\n" } @@ -77,7 +78,7 @@ for ($num_args = 2; $num_args <= $max; ++$num_args) { if ($num_args == $max) { print "#undef _GLIBCXX_LAST_INCLUDE\n" } - + print "#undef _GLIBCXX_T_NUM_ARGS_PLUS_1\n"; print "#undef _GLIBCXX_NUM_ARGS_PLUS_1\n"; print "#undef _GLIBCXX_REF_TEMPLATE_ARGS\n"; print "#undef _GLIBCXX_REF_WRAP_PARAMS\n";