forward_list.h: Remove default std::allocator<_Tp> from base classes.

2009-04-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/forward_list.h: Remove default std::allocator<_Tp>
	from base classes.
	* testsuite/23_containers/forward_list/capacity/1.cc: Adjust.

From-SVN: r146171
This commit is contained in:
Paolo Carlini 2009-04-16 11:46:25 +00:00 committed by Paolo Carlini
parent cbbdee52b8
commit 42fb6c83dd
4 changed files with 23 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2009-04-16 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/forward_list.h: Remove default std::allocator<_Tp>
from base classes.
* testsuite/23_containers/forward_list/capacity/1.cc: Adjust.
2009-04-15 Benjamin Kosnik <bkoz@redhat.com> 2009-04-15 Benjamin Kosnik <bkoz@redhat.com>
* doc/html: Regenerate. * doc/html: Regenerate.

View File

@ -314,4 +314,12 @@ _GLIBCXX_END_NAMESPACE
#undef min #undef min
#undef max #undef max
#ifndef _GLIBCXX_PURE
# define _GLIBCXX_PURE __attribute__ ((__pure__))
#endif
#ifndef _GLIBCXX_CONST
# define _GLIBCXX_CONST __attribute__ ((__const__))
#endif
// End of prewritten config; the discovered settings follow. // End of prewritten config; the discovered settings follow.

View File

@ -81,7 +81,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* This is just a linked list with a data value in each node. * This is just a linked list with a data value in each node.
* There is a sorting utility method. * There is a sorting utility method.
*/ */
template<typename _Tp, typename _Alloc = std::allocator<_Tp> > template<typename _Tp, typename _Alloc>
struct _Fwd_list_node : public _Fwd_list_node_base<_Alloc> struct _Fwd_list_node : public _Fwd_list_node_base<_Alloc>
{ {
typedef typename _Alloc::template rebind<_Fwd_list_node<_Tp, _Alloc> > typedef typename _Alloc::template rebind<_Fwd_list_node<_Tp, _Alloc> >
@ -104,7 +104,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* *
* All the functions are op overloads. * All the functions are op overloads.
*/ */
template<typename _Tp, typename _Alloc = std::allocator<_Tp> > template<typename _Tp, typename _Alloc>
struct _Fwd_list_iterator struct _Fwd_list_iterator
{ {
typedef _Fwd_list_iterator<_Tp, _Alloc> _Self; typedef _Fwd_list_iterator<_Tp, _Alloc> _Self;
@ -171,7 +171,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* *
* All the functions are op overloads. * All the functions are op overloads.
*/ */
template<typename _Tp, typename _Alloc = std::allocator<_Tp> > template<typename _Tp, typename _Alloc>
struct _Fwd_list_const_iterator struct _Fwd_list_const_iterator
{ {
typedef _Fwd_list_const_iterator<_Tp, _Alloc> _Self; typedef _Fwd_list_const_iterator<_Tp, _Alloc> _Self;
@ -240,7 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/** /**
* @brief Forward list iterator equality comparison. * @brief Forward list iterator equality comparison.
*/ */
template<typename _Tp,class _Alloc> template<typename _Tp, typename _Alloc>
inline bool inline bool
operator==(const _Fwd_list_iterator<_Tp, _Alloc>& __x, operator==(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
const _Fwd_list_const_iterator<_Tp, _Alloc>& __y) const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
@ -249,7 +249,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/** /**
* @brief Forward list iterator inequality comparison. * @brief Forward list iterator inequality comparison.
*/ */
template<typename _Tp,class _Alloc> template<typename _Tp, typename _Alloc>
inline bool inline bool
operator!=(const _Fwd_list_iterator<_Tp, _Alloc>& __x, operator!=(const _Fwd_list_iterator<_Tp, _Alloc>& __x,
const _Fwd_list_const_iterator<_Tp, _Alloc>& __y) const _Fwd_list_const_iterator<_Tp, _Alloc>& __y)
@ -258,7 +258,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
/** /**
* @brief Base class for %forward_list. * @brief Base class for %forward_list.
*/ */
template<typename _Tp, typename _Alloc = allocator<_Tp> > template<typename _Tp, typename _Alloc>
struct _Fwd_list_base struct _Fwd_list_base
{ {
protected: protected:

View File

@ -38,8 +38,9 @@ test01()
fld.resize(0); fld.resize(0);
VERIFY(fld.empty() == true); VERIFY(fld.empty() == true);
VERIFY( fld.max_size() VERIFY( (fld.max_size()
== std::allocator<std::_Fwd_list_node<double> >().max_size() ); == std::allocator<std::_Fwd_list_node<double,
std::allocator<double> > >().max_size()) );
} }
int int