From c8bf5b7c54d47b7a25f9fed4d3772c8ae2e2bfde Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 30 Oct 2006 22:22:38 +0000 Subject: [PATCH] tuple_iterate.h (tuple_size >::value): Provide definition. 2006-10-30 Paolo Carlini * include/tr1/tuple_iterate.h (tuple_size >::value): Provide definition. * include/tr1/functional (is_bind_expression<>::value, is_placeholder<>::value, + various partial specializations): Likewise. * include/tr1/array (tuple_size >::value): Likewise. From-SVN: r118203 --- libstdc++-v3/ChangeLog | 8 +++++++ libstdc++-v3/include/tr1/array | 3 +++ libstdc++-v3/include/tr1/functional | 39 ++++++++++++++++++-------------- libstdc++-v3/include/tr1/tuple_iterate.h | 7 +++++- 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d766ecf..21f8030 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,13 @@ 2006-10-30 Paolo Carlini + * include/tr1/tuple_iterate.h (tuple_size >::value): Provide + definition. + * include/tr1/functional (is_bind_expression<>::value, + is_placeholder<>::value, + various partial specializations): Likewise. + * include/tr1/array (tuple_size >::value): Likewise. + +2006-10-30 Paolo Carlini + * testsuite/tr1/6_containers/array/capacity/max_size.cc: Actually do test max_size(). diff --git a/libstdc++-v3/include/tr1/array b/libstdc++-v3/include/tr1/array index 4389874..1afd7db 100644 --- a/libstdc++-v3/include/tr1/array +++ b/libstdc++-v3/include/tr1/array @@ -243,6 +243,9 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) struct tuple_size > { static const int value = _Nm; }; + template + const int tuple_size >::value; + template struct tuple_element<_Int, array<_Tp, _Nm> > { typedef _Tp type; }; diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional index ef85e5b..44d9154 100644 --- a/libstdc++-v3/include/tr1/functional +++ b/libstdc++-v3/include/tr1/functional @@ -514,9 +514,10 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) */ template struct is_bind_expression - { - static const bool value = false; - }; + { static const bool value = false; }; + + template + const bool is_bind_expression<_Tp>::value; /** * @brief Determines if the given type _Tp is a placeholder in a @@ -524,9 +525,10 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) */ template struct is_placeholder - { - static const int value = 0; - }; + { static const int value = 0; }; + + template + const int is_placeholder<_Tp>::value; /** * @if maint @@ -543,9 +545,10 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) */ template struct is_placeholder<_Placeholder<_Num> > - { - static const int value = _Num; - }; + { static const int value = _Num; }; + + template + const int is_placeholder<_Placeholder<_Num> >::value; /** * @if maint @@ -714,10 +717,11 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) * @endif */ template - struct is_bind_expression<_Bind<_Signature> > - { - static const bool value = true; - }; + struct is_bind_expression<_Bind<_Signature> > + { static const bool value = true; }; + + template + const bool is_bind_expression<_Bind<_Signature> >::value; /** * @if maint @@ -725,10 +729,11 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) * @endif */ template - struct is_bind_expression<_Bind_result<_Result, _Signature> > - { - static const bool value = true; - }; + struct is_bind_expression<_Bind_result<_Result, _Signature> > + { static const bool value = true; }; + + template + const bool is_bind_expression<_Bind_result<_Result, _Signature> >::value; /** * @brief Exception class thrown when class template function's diff --git a/libstdc++-v3/include/tr1/tuple_iterate.h b/libstdc++-v3/include/tr1/tuple_iterate.h index 8d57576..da6166e 100644 --- a/libstdc++-v3/include/tr1/tuple_iterate.h +++ b/libstdc++-v3/include/tr1/tuple_iterate.h @@ -1,6 +1,6 @@ // class template tuple -*- C++ -*- -// Copyright (C) 2004, 2005 Free Software Foundation, Inc. +// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -39,6 +39,11 @@ template<_GLIBCXX_TEMPLATE_PARAMS> struct tuple_size > { static const int value = _GLIBCXX_NUM_ARGS; }; +#if _GLIBCXX_NUM_ARGS > 0 +template<_GLIBCXX_TEMPLATE_PARAMS> + const int tuple_size >::value; +#endif + template<_GLIBCXX_TEMPLATE_PARAMS> #ifdef _GLIBCXX_LAST_INCLUDE class tuple -- 2.7.4