Commit 8f7a4015 by Benjamin Kosnik Committed by Benjamin Kosnik

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
parent c66c8b0e
2002-01-16 Benjamin Kosnik <bkoz@redhat.com> 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 Khl 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. * libmath/signbitl.c: Copyright years as list, not range.
* libmath/Makefile.am: Same. * libmath/Makefile.am: Same.
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,18 @@ ...@@ -33,17 +33,18 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
{ } { }
char char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,18 @@ ...@@ -33,17 +33,18 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _S_ctable)
_M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table)
{ } { }
char char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,19 @@ ...@@ -33,17 +33,19 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _ctype_ + 1)
_M_ctable(NULL), _M_table(__table == 0 ? (_ctype_ + 1) : __table)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _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 char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,18 +33,21 @@ ...@@ -33,18 +33,21 @@
// Information as gleaned from DJGPP <ctype.h> // 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, ctype<char>::ctype(__c_locale, const mask* __table = 0, bool __del = false,
size_t __refs = 0) size_t __refs = 0)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), _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, ctype<char>::ctype(const mask* __table = 0, bool __del = false,
size_t __refs = 0) size_t __refs = 0)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower), _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 char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +34,20 @@ ...@@ -33,17 +34,20 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 == 0 ? _M_ctable : __table) _M_table(__table == 0 ? _S_ctable : __table)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 == 0 ? _M_ctable : __table) _M_table(__table == 0 ? _S_ctable : __table)
{ } { }
char char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -39,11 +40,13 @@ ...@@ -39,11 +40,13 @@
using _C_legacy::__ctype_b; using _C_legacy::__ctype_b;
#endif #endif
// Data for classic_table().
const ctype_base::mask* ctype<char>::_S_ctable = __ctype_b;
#if _GLIBCPP_C_LOCALE_GNU #if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del, ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
_M_ctable(__ctype_b)
{ {
_M_c_locale_ctype = _S_clone_c_locale(__cloc); _M_c_locale_ctype = _S_clone_c_locale(__cloc);
_M_toupper = _M_c_locale_ctype->__ctype_toupper; _M_toupper = _M_c_locale_ctype->__ctype_toupper;
...@@ -55,14 +58,14 @@ ...@@ -55,14 +58,14 @@
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), _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; } { _M_c_locale_ctype = NULL; }
#endif #endif
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) : ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
__ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), _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; } { _M_c_locale_ctype = NULL; }
char char
......
...@@ -34,17 +34,20 @@ ...@@ -34,17 +34,20 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 == 0 ? (const mask *) __SB_masks : __table) _M_table(__table ? __table : (const mask *) __SB_masks)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 == 0 ? (const mask *) __SB_masks : __table) _M_table(__table ? __table : (const mask *) __SB_masks)
{ } { }
char char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,16 +34,19 @@ ...@@ -33,16 +34,19 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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) _M_table(!__table ? __ctype : __table)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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) _M_table(!__table ? __ctype : __table)
{ } { }
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,21 @@ ...@@ -33,17 +33,21 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 ? _M_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
{ } { }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __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 ? _M_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table) (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
{ } { }
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,20 @@ ...@@ -33,17 +33,20 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(_ctype_), _M_toupper(NULL), _M_tolower(NULL),
_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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(_ctype_), _M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? _M_ctable : __table) _M_table(__table ? __table : _S_ctable)
{ } { }
char char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,20 @@ ...@@ -33,17 +33,20 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(__ctype), _M_toupper(NULL), _M_tolower(NULL),
_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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_ctable(__ctype), _M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? _M_ctable: __table) _M_table(__table ? __table : _S_ctable)
{ } { }
char char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +33,20 @@ ...@@ -33,17 +33,20 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _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 char
......
// Locale support -*- C++ -*- // 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 // 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
...@@ -33,17 +34,20 @@ ...@@ -33,17 +34,20 @@
// Information as gleaned from /usr/include/ctype.h // 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, ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs) size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _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<char>::ctype(const mask* __table, bool __del, size_t __refs)
: __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del), : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower), _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 char
......
...@@ -233,12 +233,12 @@ namespace std ...@@ -233,12 +233,12 @@ namespace std
bool _M_del; bool _M_del;
__to_type _M_toupper; __to_type _M_toupper;
__to_type _M_tolower; __to_type _M_tolower;
const mask* _M_ctable;
const mask* _M_table; const mask* _M_table;
public: public:
static locale::id id; static locale::id id;
static const size_t table_size = 1 + static_cast<unsigned char>(-1); static const size_t table_size = 1 + static_cast<unsigned char>(-1);
static const mask* _S_ctable;
explicit explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0); ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
...@@ -264,9 +264,9 @@ namespace std ...@@ -264,9 +264,9 @@ namespace std
table() const throw() table() const throw()
{ return _M_table; } { return _M_table; }
const mask* static const mask*
classic_table() throw() classic_table() throw()
{ return _M_ctable; } { return _S_ctable; }
virtual virtual
~ctype(); ~ctype();
......
// Iterators -*- C++ -*- // 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 // 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
...@@ -73,7 +73,7 @@ namespace std ...@@ -73,7 +73,7 @@ namespace std
typename iterator_traits<_Iterator>::reference> typename iterator_traits<_Iterator>::reference>
{ {
protected: protected:
_Iterator _M_current; _Iterator current;
public: public:
typedef _Iterator iterator_type; typedef _Iterator iterator_type;
...@@ -86,22 +86,22 @@ namespace std ...@@ -86,22 +86,22 @@ namespace std
reverse_iterator() { } reverse_iterator() { }
explicit explicit
reverse_iterator(iterator_type __x) : _M_current(__x) { } reverse_iterator(iterator_type __x) : current(__x) { }
reverse_iterator(const reverse_iterator& __x) reverse_iterator(const reverse_iterator& __x)
: _M_current(__x._M_current) { } : current(__x.current) { }
template<typename _Iter> template<typename _Iter>
reverse_iterator(const reverse_iterator<_Iter>& __x) reverse_iterator(const reverse_iterator<_Iter>& __x)
: _M_current(__x.base()) { } : current(__x.base()) { }
iterator_type iterator_type
base() const { return _M_current; } base() const { return current; }
reference reference
operator*() const operator*() const
{ {
_Iterator __tmp = _M_current; _Iterator __tmp = current;
return *--__tmp; return *--__tmp;
} }
...@@ -111,7 +111,7 @@ namespace std ...@@ -111,7 +111,7 @@ namespace std
reverse_iterator& reverse_iterator&
operator++() operator++()
{ {
--_M_current; --current;
return *this; return *this;
} }
...@@ -119,43 +119,43 @@ namespace std ...@@ -119,43 +119,43 @@ namespace std
operator++(int) operator++(int)
{ {
reverse_iterator __tmp = *this; reverse_iterator __tmp = *this;
--_M_current; --current;
return __tmp; return __tmp;
} }
reverse_iterator& reverse_iterator&
operator--() operator--()
{ {
++_M_current; ++current;
return *this; return *this;
} }
reverse_iterator operator--(int) reverse_iterator operator--(int)
{ {
reverse_iterator __tmp = *this; reverse_iterator __tmp = *this;
++_M_current; ++current;
return __tmp; return __tmp;
} }
reverse_iterator reverse_iterator
operator+(difference_type __n) const operator+(difference_type __n) const
{ return reverse_iterator(_M_current - __n); } { return reverse_iterator(current - __n); }
reverse_iterator& reverse_iterator&
operator+=(difference_type __n) operator+=(difference_type __n)
{ {
_M_current -= __n; current -= __n;
return *this; return *this;
} }
reverse_iterator reverse_iterator
operator-(difference_type __n) const operator-(difference_type __n) const
{ return reverse_iterator(_M_current + __n); } { return reverse_iterator(current + __n); }
reverse_iterator& reverse_iterator&
operator-=(difference_type __n) operator-=(difference_type __n)
{ {
_M_current += __n; current += __n;
return *this; return *this;
} }
...@@ -217,18 +217,18 @@ namespace std ...@@ -217,18 +217,18 @@ namespace std
: public iterator<output_iterator_tag, void, void, void, void> : public iterator<output_iterator_tag, void, void, void, void>
{ {
protected: protected:
_Container* _M_container; _Container* container;
public: public:
typedef _Container container_type; typedef _Container container_type;
explicit explicit
back_insert_iterator(_Container& __x) : _M_container(&__x) { } back_insert_iterator(_Container& __x) : container(&__x) { }
back_insert_iterator& back_insert_iterator&
operator=(typename _Container::const_reference __value) operator=(typename _Container::const_reference __value)
{ {
_M_container->push_back(__value); container->push_back(__value);
return *this; return *this;
} }
...@@ -252,17 +252,17 @@ namespace std ...@@ -252,17 +252,17 @@ namespace std
: public iterator<output_iterator_tag, void, void, void, void> : public iterator<output_iterator_tag, void, void, void, void>
{ {
protected: protected:
_Container* _M_container; _Container* container;
public: public:
typedef _Container container_type; typedef _Container container_type;
explicit front_insert_iterator(_Container& __x) : _M_container(&__x) { } explicit front_insert_iterator(_Container& __x) : container(&__x) { }
front_insert_iterator& front_insert_iterator&
operator=(typename _Container::const_reference __value) operator=(typename _Container::const_reference __value)
{ {
_M_container->push_front(__value); container->push_front(__value);
return *this; return *this;
} }
...@@ -286,19 +286,19 @@ namespace std ...@@ -286,19 +286,19 @@ namespace std
: public iterator<output_iterator_tag, void, void, void, void> : public iterator<output_iterator_tag, void, void, void, void>
{ {
protected: protected:
_Container* _M_container; _Container* container;
typename _Container::iterator iter; typename _Container::iterator iter;
public: public:
typedef _Container container_type; typedef _Container container_type;
insert_iterator(_Container& __x, typename _Container::iterator __i) insert_iterator(_Container& __x, typename _Container::iterator __i)
: _M_container(&__x), iter(__i) {} : container(&__x), iter(__i) {}
insert_iterator& insert_iterator&
operator=(const typename _Container::const_reference __value) operator=(const typename _Container::const_reference __value)
{ {
iter = _M_container->insert(iter, __value); iter = container->insert(iter, __value);
++iter; ++iter;
return *this; return *this;
} }
......
...@@ -234,9 +234,19 @@ void test02() ...@@ -234,9 +234,19 @@ void test02()
VERIFY( v_c != v_de ); VERIFY( v_c != v_de );
} }
// Dietmar Khl via Peter Schmid
class comma_ctype: public std::ctype<char>
{
public:
comma_ctype(): std::ctype<char>() { }
static void get_table()
{ classic_table(); }
};
int main() int main()
{ {
test01(); test01();
test02(); test02();
return 0; return 0;
} }
// 2001-06-21 Benjamin Kosnik <bkoz@redhat.com> // 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 // 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
...@@ -54,6 +54,15 @@ void test02() ...@@ -54,6 +54,15 @@ void test02()
iterator_type it = std::back_inserter(li); 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() int main()
{ {
test01(); test01();
......
...@@ -53,6 +53,15 @@ void test02() ...@@ -53,6 +53,15 @@ void test02()
iterator_type it = std::front_inserter(li); 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() int main()
{ {
test01(); test01();
......
...@@ -60,6 +60,16 @@ void test02() ...@@ -60,6 +60,16 @@ void test02()
iterator_type it02 = std::inserter(li, liit); 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() int main()
{ {
test01(); test01();
......
// 2001-06-21 Benjamin Kosnik <bkoz@redhat.com> // 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 // 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
...@@ -67,6 +67,13 @@ void test02() ...@@ -67,6 +67,13 @@ void test02()
5 + it02; 5 + it02;
} }
// Check data member 'current' accessible.
class test_dm : public std::reverse_iterator<int*>
{
int* p;
public:
test_dm(): p(current) { }
};
int main() int main()
{ {
...@@ -74,5 +81,3 @@ int main() ...@@ -74,5 +81,3 @@ int main()
test02(); test02();
return 0; return 0;
} }
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