Commit d265b0b1 by Paolo Carlini Committed by Paolo Carlini

tuple: Only include <utility> for std::pair, and forward declare reference_wrapper...

2007-03-13  Paolo Carlini  <pcarlini@suse.de>

	* include/tr1/tuple: Only include <utility> for std::pair, and
	forward declare reference_wrapper; formatting fixes.
	* include/tr1/ref_fwd.h: Remove.
	* include/tr1/tuple_defs.h: Remove, unused.
	* include/Makefile.am: Update.
	* include/Makefile.in: Regenerate.
	* testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc:
	Include <tr1/functional> too.

	* include/tr1/tuple: Define tuple_size<tuple<_Elements...> >::value.

From-SVN: r122883
parent bde6c7a9
2007-03-13 Paolo Carlini <pcarlini@suse.de>
* include/tr1/tuple: Only include <utility> for std::pair, and
forward declare reference_wrapper; formatting fixes.
* include/tr1/ref_fwd.h: Remove.
* include/tr1/tuple_defs.h: Remove, unused.
* include/Makefile.am: Update.
* include/Makefile.in: Regenerate.
* testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc:
Include <tr1/functional> too.
* include/tr1/tuple: Define tuple_size<tuple<_Elements...> >::value.
2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com> 2007-03-12 Stephen M. Webb <stephen.webb@bregmasoft.com>
* include/tr1/regex: Add "boilerplate" implementations. * include/tr1/regex: Add "boilerplate" implementations.
......
...@@ -566,7 +566,6 @@ tr1_headers = \ ...@@ -566,7 +566,6 @@ tr1_headers = \
${tr1_srcdir}/memory \ ${tr1_srcdir}/memory \
${tr1_srcdir}/random \ ${tr1_srcdir}/random \
${tr1_srcdir}/random.tcc \ ${tr1_srcdir}/random.tcc \
${tr1_srcdir}/ref_fwd.h \
${tr1_srcdir}/regex \ ${tr1_srcdir}/regex \
${tr1_srcdir}/stdarg.h \ ${tr1_srcdir}/stdarg.h \
${tr1_srcdir}/stdbool.h \ ${tr1_srcdir}/stdbool.h \
......
...@@ -796,7 +796,6 @@ tr1_headers = \ ...@@ -796,7 +796,6 @@ tr1_headers = \
${tr1_srcdir}/memory \ ${tr1_srcdir}/memory \
${tr1_srcdir}/random \ ${tr1_srcdir}/random \
${tr1_srcdir}/random.tcc \ ${tr1_srcdir}/random.tcc \
${tr1_srcdir}/ref_fwd.h \
${tr1_srcdir}/regex \ ${tr1_srcdir}/regex \
${tr1_srcdir}/stdarg.h \ ${tr1_srcdir}/stdarg.h \
${tr1_srcdir}/stdbool.h \ ${tr1_srcdir}/stdbool.h \
......
// class template reference_wrapper forwarding header -*- C++ -*-
// Copyright (C) 2004, 2005 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/ref_fwd.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
// Douglas Gregor <doug.gregor -at- gmail.com>
#ifndef _TR1_REF_FWD
#define _TR1_REF_FWD
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
template<typename _Tp>
class reference_wrapper;
template<typename _Tp>
reference_wrapper<_Tp>
ref(_Tp& __t);
// Denotes a const reference should be taken to a variable.
template<typename _Tp>
reference_wrapper<const _Tp>
cref(const _Tp& __t);
_GLIBCXX_END_NAMESPACE
}
#endif
// class template tuple -*- C++ -*-
// Copyright (C) 2004, 2005 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/tuple_defs.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
#ifndef _GLIBCXX_REPEAT_HEADER
# define _GLIBCXX_REPEAT_HEADER "tuple_defs.h"
# include "repeat.h"
# undef _GLIBCXX_REPEAT_HEADER
#endif
#ifdef _GLIBCXX_LAST_INCLUDE
// Chris Jefferson <chris@bubblescope.net>
template<_GLIBCXX_TEMPLATE_PARAMS_NULL_CLASS> class tuple;
// Returns a const reference to the ith element of a tuple.
// Any const or non-const ref elements are returned with their original type.
template<int __i, _GLIBCXX_TEMPLATE_PARAMS>
typename __add_ref<typename tuple_element<__i, tuple<_GLIBCXX_TEMPLATE_ARGS> >::type>::type
get(tuple<_GLIBCXX_TEMPLATE_ARGS>& __t)
{
return __get_helper<__i, tuple<_GLIBCXX_TEMPLATE_ARGS> >::get_value(__t);
}
template<int __i, _GLIBCXX_TEMPLATE_PARAMS>
typename __add_c_ref<typename tuple_element<__i, tuple<_GLIBCXX_TEMPLATE_ARGS> >::type>::type
get(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t)
{
return __get_helper<__i, tuple<_GLIBCXX_TEMPLATE_ARGS> >::get_value(__t);
}
template<_GLIBCXX_TEMPLATE_PARAMS, _GLIBCXX_TEMPLATE_PARAMS_U>
bool
operator==(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t,
const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __u)
{
typedef tuple<_GLIBCXX_TEMPLATE_ARGS> _Tp;
typedef tuple<_GLIBCXX_TEMPLATE_ARGS_U> _Up;
return __tuple_compare<tuple_size<_Tp>::value - tuple_size<_Tp>::value, 0,
tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u);
}
template<_GLIBCXX_TEMPLATE_PARAMS, _GLIBCXX_TEMPLATE_PARAMS_U>
bool
operator<(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t,
const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __u)
{
typedef tuple<_GLIBCXX_TEMPLATE_ARGS> _Tp;
typedef tuple<_GLIBCXX_TEMPLATE_ARGS_U> _Up;
return __tuple_compare<tuple_size<_Tp>::value - tuple_size<_Tp>::value, 0,
tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u);
}
template<_GLIBCXX_TEMPLATE_PARAMS, _GLIBCXX_TEMPLATE_PARAMS_U>
bool
operator!=(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t,
const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __u)
{ return !(__t == __u); }
template<_GLIBCXX_TEMPLATE_PARAMS, _GLIBCXX_TEMPLATE_PARAMS_U>
bool
operator>(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t,
const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __u)
{ return __u < __t; }
template<_GLIBCXX_TEMPLATE_PARAMS, _GLIBCXX_TEMPLATE_PARAMS_U>
bool
operator<=(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t,
const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __u)
{ return !(__u < __t); }
template<_GLIBCXX_TEMPLATE_PARAMS, _GLIBCXX_TEMPLATE_PARAMS_U>
bool
operator>=(const tuple<_GLIBCXX_TEMPLATE_ARGS>& __t,
const tuple<_GLIBCXX_TEMPLATE_ARGS_U>& __u)
{ return !(__t < __u); }
template<_GLIBCXX_TEMPLATE_PARAMS_NULL_CLASS>
struct __stripped_tuple_type
{
typedef tuple<_GLIBCXX_TEMPLATE_ARGS_STRIPPED> __type;
};
#endif
// 2004-09-23 Chris Jefferson <chris@bubblescope.net> // 2004-09-23 Chris Jefferson <chris@bubblescope.net>
// Copyright (C) 2004 Free Software Foundation, Inc. // Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // 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 // software; you can redistribute it and/or modify it under the
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
// Tuple // Tuple
#include <tr1/tuple> #include <tr1/tuple>
#include <tr1/functional>
#include <testsuite_hooks.h> #include <testsuite_hooks.h>
using namespace std; using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment