stl_iterator.h (reverse_iterator::_M_current): Deuglify, should be current.

2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>
            Peter Schmid  <schmid@snake.iap.physik.tu-darmstadt.de>

	* include/bits/stl_iterator.h (reverse_iterator::_M_current):
	Deuglify, should be current.
	(back_insert_iterator::_M_container): Deuglify, should be container.
	(front_insert_iterator::_M_container): Same.
	(insert_iterator::_M_container): Same.
	* testsuite/24_iterators/reverse_iterator.cc: Add check.
	* testsuite/24_iterators/back_insert_iterator.cc: Add check.
	* testsuite/24_iterators/front_insert_iterator.cc: Same.
	* testsuite/24_iterators/insert_iterator.cc: Same.

2002-01-16  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/locale_facets.h (ctype<char>::classic_table): Make
	static.
	(ctype<char>::_M_ctable): Make static, change name to _S_ctable.
	* config/os/gnu-linux/bits/ctype_noninline.h: Define _S_ctable.
	* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
	* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
	* config/os/newlib/bits/ctype_noninline.h: Same.
	* config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
	* config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
	* config/os/hpux/bits/ctype_noninline.h: Same.
	* config/os/djgpp/bits/ctype_noninline.h: Same.
	* config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
	* config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
	* config/os/aix/bits/ctype_noninline.h: Same.

	Testcase by Dietmar K�hl via Peter Schmid
	* testsuite/22_locale/ctype_members_char.cc (char>): Add test for
	classic_table().

Co-Authored-By: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>

From-SVN: r48938
This commit is contained in:
Benjamin Kosnik 2002-01-17 03:59:42 +00:00 committed by Benjamin Kosnik
parent c66c8b0e65
commit 8f7a401515
21 changed files with 200 additions and 84 deletions

View File

@ -1,3 +1,38 @@
2002-01-16 Benjamin Kosnik <bkoz@redhat.com>
Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>
* include/bits/stl_iterator.h (reverse_iterator::_M_current):
Deuglify, should be current.
(back_insert_iterator::_M_container): Deuglify, should be container.
(front_insert_iterator::_M_container): Same.
(insert_iterator::_M_container): Same.
* testsuite/24_iterators/reverse_iterator.cc: Add check.
* testsuite/24_iterators/back_insert_iterator.cc: Add check.
* testsuite/24_iterators/front_insert_iterator.cc: Same.
* testsuite/24_iterators/insert_iterator.cc: Same.
2002-01-16 Benjamin Kosnik <bkoz@redhat.com>
* include/bits/locale_facets.h (ctype<char>::classic_table): Make
static.
(ctype<char>::_M_ctable): Make static, change name to _S_ctable.
* config/os/gnu-linux/bits/ctype_noninline.h: Define _S_ctable.
* config/os/solaris/solaris2.7/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.6/bits/ctype_noninline.h: Same.
* config/os/solaris/solaris2.5/bits/ctype_noninline.h: Same.
* config/os/newlib/bits/ctype_noninline.h: Same.
* config/os/irix/irix6.5/bits/ctype_noninline.h: Same.
* config/os/irix/irix5.2/bits/ctype_noninline.h: Same.
* config/os/hpux/bits/ctype_noninline.h: Same.
* config/os/djgpp/bits/ctype_noninline.h: Same.
* config/os/bsd/netbsd/bits/ctype_noninline.h: Same.
* config/os/bsd/freebsd/bits/ctype_noninline.h: Same.
* config/os/aix/bits/ctype_noninline.h: Same.
Testcase by Dietmar Kühl via Peter Schmid
* testsuite/22_locale/ctype_members_char.cc (char>): Add test for
classic_table().
2002-01-16 Benjamin Kosnik <bkoz@redhat.com>
* libmath/signbitl.c: Copyright years as list, not range.

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002 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
@ -32,18 +32,19 @@
//
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
{ }
char

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002 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
@ -33,17 +33,18 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
{ }
char

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002 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
@ -33,17 +33,19 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? (_ctype_ + 1) : __table)
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_ctable(NULL), _M_table(__table == 0 ? (_ctype_ + 1) : __table)
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
{ }
char

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 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
@ -33,18 +33,21 @@
// Information as gleaned from DJGPP <ctype.h>
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false,
size_t __refs = 0)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_ctable(NULL), _M_table(__table == 0 ? __dj_ctype_flags : __table)
_M_table(__table ? __table : __dj_ctype_flags)
{ }
ctype<char>::ctype(const mask* __table = 0, bool __del = false,
size_t __refs = 0)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_ctable(NULL), _M_table(__table == 0 ? __dj_ctype_flags : __table)
_M_table(__table ? __table : __dj_ctype_flags)
{ }
char

View File

@ -1,6 +1,7 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// 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
@ -32,18 +33,21 @@
//
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_table(__table == 0 ? _M_ctable : __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? _S_ctable : __table)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_table(__table == 0 ? _M_ctable : __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? _S_ctable : __table)
{ }
char

View File

@ -1,6 +1,7 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// 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,11 +40,13 @@
using _C_legacy::__ctype_b;
#endif
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b;
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_ctable(__ctype_b)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
{
_M_c_locale_ctype = _S_clone_c_locale(__cloc);
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
@ -55,14 +58,14 @@
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
_M_ctable(__ctype_b), _M_table(__table ? __table : __ctype_b)
_M_table(__table ? __table : _S_ctable)
{ _M_c_locale_ctype = NULL; }
#endif
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
_M_ctable(__ctype_b), _M_table(__table == 0 ? _M_ctable : __table)
_M_table(__table ? __table : _S_ctable)
{ _M_c_locale_ctype = NULL; }
char

View File

@ -33,18 +33,21 @@
//
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_table(__table == 0 ? (const mask *) __SB_masks : __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : (const mask *) __SB_masks)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_table(__table == 0 ? (const mask *) __SB_masks : __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : (const mask *) __SB_masks)
{ }
char

View File

@ -1,6 +1,7 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2001, 2002
// 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
@ -33,16 +34,19 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ? __ctype : __table)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ? __ctype : __table)
{ }

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-1999, 2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2001, 2002 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
@ -33,17 +33,21 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(const mask* __tab
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(NULL),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
{ }

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002 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
@ -33,17 +33,20 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(_ctype_),
_M_table(__table == 0 ? _M_ctable : __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : _S_ctable)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(_ctype_),
_M_table(__table == 0 ? _M_ctable : __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : _S_ctable)
{ }
char

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
// Copyright (C) 2000, 2001, 2002 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
@ -32,18 +32,21 @@
//
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(__ctype),
_M_table(__table == 0 ? _M_ctable: __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : _S_ctable)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(__ctype),
_M_table(__table == 0 ? _M_ctable: __table)
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : _S_ctable)
{ }
char

View File

@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2001, 2002 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
@ -33,17 +33,20 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table)
_M_ctable(__ctype_mask), _M_table(__table ? __table : _M_ctable)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table)
_M_ctable(__ctype_mask), _M_table(__table ? __table : _M_ctable)
{ }
char

View File

@ -1,6 +1,7 @@
// Locale support -*- C++ -*-
// Copyright (C) 1997-2001 Free Software Foundation, Inc.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// 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
@ -33,17 +34,20 @@
// Information as gleaned from /usr/include/ctype.h
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable = __ctype_mask;
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table)
_M_table(__table ? __table : _S_ctable)
{ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table)
_M_table(__table == 0 ? __table : _S_ctable)
{ }
char

View File

@ -233,12 +233,12 @@ namespace std
bool _M_del;
__to_type _M_toupper;
__to_type _M_tolower;
const mask* _M_ctable;
const mask* _M_table;
public:
static locale::id id;
static const size_t table_size = 1 + static_cast<unsigned char>(-1);
static const mask* _S_ctable;
explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
@ -264,9 +264,9 @@ namespace std
table() const throw()
{ return _M_table; }
const mask*
static const mask*
classic_table() throw()
{ return _M_ctable; }
{ return _S_ctable; }
virtual
~ctype();

View File

@ -1,6 +1,6 @@
// Iterators -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 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
@ -73,7 +73,7 @@ namespace std
typename iterator_traits<_Iterator>::reference>
{
protected:
_Iterator _M_current;
_Iterator current;
public:
typedef _Iterator iterator_type;
@ -86,22 +86,22 @@ namespace std
reverse_iterator() { }
explicit
reverse_iterator(iterator_type __x) : _M_current(__x) { }
reverse_iterator(iterator_type __x) : current(__x) { }
reverse_iterator(const reverse_iterator& __x)
: _M_current(__x._M_current) { }
: current(__x.current) { }
template<typename _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x)
: _M_current(__x.base()) { }
: current(__x.base()) { }
iterator_type
base() const { return _M_current; }
base() const { return current; }
reference
operator*() const
{
_Iterator __tmp = _M_current;
_Iterator __tmp = current;
return *--__tmp;
}
@ -111,7 +111,7 @@ namespace std
reverse_iterator&
operator++()
{
--_M_current;
--current;
return *this;
}
@ -119,43 +119,43 @@ namespace std
operator++(int)
{
reverse_iterator __tmp = *this;
--_M_current;
--current;
return __tmp;
}
reverse_iterator&
operator--()
{
++_M_current;
++current;
return *this;
}
reverse_iterator operator--(int)
{
reverse_iterator __tmp = *this;
++_M_current;
++current;
return __tmp;
}
reverse_iterator
operator+(difference_type __n) const
{ return reverse_iterator(_M_current - __n); }
{ return reverse_iterator(current - __n); }
reverse_iterator&
operator+=(difference_type __n)
{
_M_current -= __n;
current -= __n;
return *this;
}
reverse_iterator
operator-(difference_type __n) const
{ return reverse_iterator(_M_current + __n); }
{ return reverse_iterator(current + __n); }
reverse_iterator&
operator-=(difference_type __n)
{
_M_current += __n;
current += __n;
return *this;
}
@ -217,18 +217,18 @@ namespace std
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_Container* _M_container;
_Container* container;
public:
typedef _Container container_type;
explicit
back_insert_iterator(_Container& __x) : _M_container(&__x) { }
back_insert_iterator(_Container& __x) : container(&__x) { }
back_insert_iterator&
operator=(typename _Container::const_reference __value)
{
_M_container->push_back(__value);
container->push_back(__value);
return *this;
}
@ -252,17 +252,17 @@ namespace std
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_Container* _M_container;
_Container* container;
public:
typedef _Container container_type;
explicit front_insert_iterator(_Container& __x) : _M_container(&__x) { }
explicit front_insert_iterator(_Container& __x) : container(&__x) { }
front_insert_iterator&
operator=(typename _Container::const_reference __value)
{
_M_container->push_front(__value);
container->push_front(__value);
return *this;
}
@ -286,19 +286,19 @@ namespace std
: public iterator<output_iterator_tag, void, void, void, void>
{
protected:
_Container* _M_container;
_Container* container;
typename _Container::iterator iter;
public:
typedef _Container container_type;
insert_iterator(_Container& __x, typename _Container::iterator __i)
: _M_container(&__x), iter(__i) {}
: container(&__x), iter(__i) {}
insert_iterator&
operator=(const typename _Container::const_reference __value)
{
iter = _M_container->insert(iter, __value);
iter = container->insert(iter, __value);
++iter;
return *this;
}

View File

@ -234,9 +234,19 @@ void test02()
VERIFY( v_c != v_de );
}
// Dietmar Kühl via Peter Schmid
class comma_ctype: public std::ctype<char>
{
public:
comma_ctype(): std::ctype<char>() { }
static void get_table()
{ classic_table(); }
};
int main()
{
test01();
test02();
return 0;
}

View File

@ -1,6 +1,6 @@
// 2001-06-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 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
@ -54,6 +54,15 @@ void test02()
iterator_type it = std::back_inserter(li);
}
// Check data member 'container' accessible.
class test_dm : public std::back_insert_iterator<std::list<int> >
{
container_type l;
container_type* p;
public:
test_dm(): std::back_insert_iterator<std::list<int> >(l), p(container) { }
};
int main()
{
test01();

View File

@ -53,6 +53,15 @@ void test02()
iterator_type it = std::front_inserter(li);
}
// Check data member 'container' accessible.
class test_dm : public std::front_insert_iterator<std::list<int> >
{
container_type l;
container_type* p;
public:
test_dm(): std::front_insert_iterator<std::list<int> >(l), p(container) { }
};
int main()
{
test01();

View File

@ -60,6 +60,16 @@ void test02()
iterator_type it02 = std::inserter(li, liit);
}
// Check data member 'container' accessible.
class test_dm : public std::insert_iterator<std::list<int> >
{
container_type l;
container_type::iterator i;
container_type* p;
public:
test_dm(): std::insert_iterator<std::list<int> >(l, i), p(container) { }
};
int main()
{
test01();

View File

@ -1,6 +1,6 @@
// 2001-06-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001 Free Software Foundation, Inc.
// Copyright (C) 2001, 2002 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
@ -67,6 +67,13 @@ void test02()
5 + it02;
}
// Check data member 'current' accessible.
class test_dm : public std::reverse_iterator<int*>
{
int* p;
public:
test_dm(): p(current) { }
};
int main()
{
@ -74,5 +81,3 @@ int main()
test02();
return 0;
}