Commit Graph

19 Commits

Author SHA1 Message Date
Paolo Carlini 1c846af9c5 rc_string_base.h (_M_compare<wchar_t>): Protect with _GLIBCXX_USE_WCHAR_T.
2006-10-02  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/rc_string_base.h (_M_compare<wchar_t>):
	Protect with _GLIBCXX_USE_WCHAR_T.
	* include/ext/sso_string_base.h (_M_compare<wchar_t>):
	Likewise.
	(__sso_string_base<>::_M_destroy): Inline.

From-SVN: r117373
2006-10-02 16:09:19 +00:00
Paolo Carlini 6c331f73fb sso_string_base.h (__sso_string_base<>::_M_max_size(), [...]): Use _M_get_allocator.
2006-09-21  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_max_size(),
	_M_destroy, _M_create): Use _M_get_allocator.

From-SVN: r117111
2006-09-21 13:39:38 +00:00
Paolo Carlini 3ad7074772 PR libstdc++/29134 (ext/vstring bits)
2006-09-21  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/29134 (ext/vstring bits)
	* include/ext/sso_string_base.h (__sso_string_base<>::_S_max_size):
	Remove.
	(__sso_string_base<>::_M_max_size): Use allocator' max_size.
	(__sso_string_base<>::_M_create): Adjust.
	* include/ext/vstring.h: Minor comment tweak.
	* testsuite/ext/vstring/capacity/29134.cc: New.

From-SVN: r117109
2006-09-21 10:34:48 +00:00
Paolo Carlini 7867a3f739 re PR libstdc++/28765 (__gnu_cxx::__vstring::clear() is slow)
2006-08-18  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/28765
	* include/ext/rc_string_base.h (_M_clear): New.
	* include/ext/sso_string_base.h (_M_clear): Likewise.
	* include/ext/vstring.h (clear): Use it.

From-SVN: r116240
2006-08-18 15:42:05 +00:00
Paolo Carlini 7aa6ba766c [multiple changes]
2006-07-03  Ian Lance Taylor  <ian@airs.com>
	    Paolo Carlini  <pcarlini@suse.de>

	* include/ext/rc_string_base.h (__rc_string_base::_S_max_size):
	Increase by a factor of two.
	* include/ext/sso_string_base.h (__sso_string_base::_S_max_size):
	Likewise.

2006-07-03  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base::_M_create): Never
	allocate a string bigger than _S_max_size.

From-SVN: r115155
2006-07-03 17:31:46 +00:00
Paolo Carlini f7ace77f1f sso_string_base.h (__sso_string_base<>::_M_dataplus): Use _CharT_alloc_type as base class.
2006-01-04  Paolo Carlini  <pcarlini@suse.de>

        * include/ext/sso_string_base.h (__sso_string_base<>::_M_dataplus):
        Use _CharT_alloc_type as base class.
        (_M_get_allocator, _M_swap, _M_create, _M_destroy): Adjust.
        * include/ext/vstring.h (get_allocator): Tidy.

2006-01-04  Paolo Carlini  <pcarlini@suse.de>

	Implement Option 3 of DR 431 for all the containers.
	* include/bits/allocator.h (struct __alloc_swap): Add, swaps
	allocators, optimized to nothing in case they are empty.
	* include/bits/stl_deque.h (deque<>::swap): Use it.
	* include/bits/stl_list.h (list<>::swap): Likewise.
	* include/bits/stl_tree.h (_Rb_tree<>::swap): Likewise.
	* include/bits/stl_vector.h (vector<>::swap): Likewise.
	* include/tr1/hashtable (hashtable<>::swap): Likewise.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_swap):
	Likewise.
	* include/ext/sso_string_base.h (__sso_string_base<>::_M_swap):
	Likewise.
	* include/ext/vstring_util.h (__vstring_utility<>::_Alloc_hider):
	Clean-up (now vstring uses the generic __alloc_swap facility).
	* include/tr1/unordered_map: Adjust includes.
	* include/tr1/unordered_set: Likewise.
	* docs/html/ext/howto.html: Add an entry for DR 431.
	* testsuite/23_containers/deque/modifiers/swap.cc: Move to...
	* testsuite/23_containers/deque/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/deque/modifiers/swap/2.cc: New.
	* testsuite/23_containers/deque/modifiers/swap/3.cc: New.
	* testsuite/23_containers/list/modifiers/swap.cc: Move to...
	* testsuite/23_containers/list/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/list/modifiers/swap/2.cc: New.
	* testsuite/23_containers/list/modifiers/swap/3.cc: New.
	* testsuite/23_containers/vector/modifiers/swap.cc: Move to...
	* testsuite/23_containers/vector/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/vector/modifiers/swap/2.cc: New.
	* testsuite/23_containers/vector/modifiers/swap/3.cc: New.
	* testsuite/23_containers/set/modifiers/swap.cc: Move to...
	* testsuite/23_containers/set/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/set/modifiers/swap/2.cc: New.
	* testsuite/23_containers/set/modifiers/swap/3.cc: New.
	* testsuite/23_containers/map/modifiers/swap.cc: Move to...
	* testsuite/23_containers/map/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/map/modifiers/swap/2.cc: New.
	* testsuite/23_containers/map/modifiers/swap/3.cc: New.
	* testsuite/23_containers/multiset/modifiers/swap.cc: Move to...
	* testsuite/23_containers/multiset/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/multiset/modifiers/swap/2.cc: New.
	* testsuite/23_containers/multiset/modifiers/swap/3.cc: New.
	* testsuite/23_containers/multimap/modifiers/swap.cc: Move to...
	* testsuite/23_containers/multimap/modifiers/swap/1.cc: ... here.		
	* testsuite/23_containers/multimap/modifiers/swap/2.cc: New.
	* testsuite/23_containers/multimap/modifiers/swap/3.cc: New.
	* testsuite/tr1/6_containers/unordered/swap/unordered_set/1.cc: New.	
	* testsuite/tr1/6_containers/unordered/swap/unordered_set/2.cc: New.
	* testsuite/tr1/6_containers/unordered/swap/unordered_map/1.cc: New.	
	* testsuite/tr1/6_containers/unordered/swap/unordered_map/2.cc: New.
	* testsuite/tr1/6_containers/unordered/swap/unordered_multiset/1.cc: New.	
	* testsuite/tr1/6_containers/unordered/swap/unordered_multiset/2.cc: New.
	* testsuite/tr1/6_containers/unordered/swap/unordered_multimap/1.cc: New.	
	* testsuite/tr1/6_containers/unordered/swap/unordered_multimap/2.cc: New.

From-SVN: r109324
2006-01-04 11:34:45 +00:00
Benjamin Kosnik 3cbc7af037 c++config: Add in revised namespace associations.
2005-12-18  Benjamin Kosnik  <bkoz@redhat.com>
	
	* include/bits/c++config: Add in revised namespace associations.
	_GLIBCXX_BEGIN_NAMESPACE: New macro.
	_GLIBCXX_END_NAMESPACE: Same.
	_GLIBCXX_BEGIN_NESTED_NAMESPACE: Same.
	_GLIBCXX_END_NESTED_NAMESPACE: Same.
	* acinclude.m4 (GLIBCXX_ENABLE_SYMVERS]): Add gnu-versioned-namespace.
	* configure: Regenerated.
	* config.h.in: Same.
	* config/abi/pre/gnu-versioned-namespace.ver: New.
	* config/abi/pre/gnu.ver (GLIBCXX_3.4.7): Add exports for nested
	debug mode items. 
	* include/Makefile.am (${host_builddir}/c++config.h): Fill in
	values for __GLIBCXX__ and _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION.
	* include/Makefile.in: Regnerate.
	* src/compatibility.cc: Alias new, nested definitions to exported
	symbols from non-nested __gnu_debug.
	* src/Makefile.am:  Add in ENABLE_SYMVERS_GNU_NAMESPACE.
	* src/Makefile.in: Regenerate.
	
	* docs/html/debug_mode.html: Revise for nested design.
	* docs/html/debug.html: Use debug qualifications instead of
	__gnu_debug.
	* docs/html/configopts.html: Revise documentation for
	--enable-symvers.
	
	* include/debug/formatter: Simplify namespace qualifications for
	current, nested-only reality. Add top-level namespace alias,
	namespace debug, for debug-mode containers.
	* include/debug/safe_iterator.h: Same.	
	* include/debug/set.h: Same.
	* include/debug/hash_multimap.h: Same.
	* include/debug/hash_set.h: Same.
	* include/debug/bitset
	* include/debug/safe_sequence.h: Same.
	* include/debug/multiset.h: Same.
	* include/debug/safe_base.h: Same.
	* include/debug/functions.h: Same.
	* include/debug/safe_iterator.tcc
	* include/debug/hash_multiset.h: Same.
	* include/debug/vector
	* include/debug/map.h: Same.
	* include/debug/deque
	* include/debug/hash_map.h: Same.
	* include/debug/string
	* include/debug/macros.h: Same.
	* include/debug/list
	* include/debug/debug.h: Same.
	* include/debug/multimap.h: Same.	
	* src/debug.cc: Same.
	* testsuite/23_containers/vector/invalidation/1.cc: Cleanups.
	* testsuite/23_containers/vector/invalidation/2.cc: Same.
	* testsuite/23_containers/vector/invalidation/3.cc: Same.
	* testsuite/23_containers/vector/invalidation/4.cc: Same.
	* testsuite/23_containers/deque/invalidation/1.cc: Same.
	* testsuite/23_containers/deque/invalidation/2.cc: Same.
	* testsuite/23_containers/deque/invalidation/3.cc: Same.
	* testsuite/23_containers/deque/invalidation/4.cc: Same.
	* testsuite/23_containers/multiset/invalidation/1.cc: Same.
	* testsuite/23_containers/multiset/invalidation/2.cc: Same.
	* testsuite/23_containers/multimap/invalidation/1.cc: Same.
	* testsuite/23_containers/multimap/invalidation/2.cc: Same.
	* testsuite/23_containers/bitset/invalidation/1.cc: Same.
	* testsuite/23_containers/bitset/cons/16020.cc: Same.
	* testsuite/23_containers/bitset/operations/13838.cc: Same.
	* testsuite/23_containers/list/invalidation/1.cc: Same.
	* testsuite/23_containers/list/invalidation/2.cc: Same.
	* testsuite/23_containers/list/invalidation/3.cc: Same.
	* testsuite/23_containers/list/invalidation/4.cc: Same.
	* testsuite/23_containers/set/invalidation/1.cc: Same.
	* testsuite/23_containers/set/invalidation/2.cc: Same.
	* testsuite/23_containers/map/invalidation/1.cc: Same.
	* testsuite/23_containers/map/invalidation/2.cc: Same.
	* testsuite/23_containers/map/insert/16813.cc: Same.
	
	* include/bits/basic_ios.h: Use _GLIBCXX_BEGIN_NAMESPACE(std) and
	friends.	
	* include/bits/stl_list.h: Same.
	* include/bits/stl_map.h: Same.
	* include/bits/stl_algobase.h: Same.
	* include/bits/localefwd.h: Same.
	* include/bits/valarray_array.tcc: Same.
	* include/bits/valarray_after.h: Same.
	* include/bits/gslice_array.h: Same.
	* include/bits/stl_queue.h: Same.
	* include/bits/gslice.h: Same.
	* include/bits/locale_facets.tcc: Same.
	* include/bits/locale_classes.h: Same.
	* include/bits/stl_set.h: Same.
	* include/bits/locale_facets.h: Same.
	* include/bits/stl_stack.h: Same.
	* include/bits/stl_iterator_base_types.h: Same.
	* include/bits/stl_heap.h: Same.
	* include/bits/indirect_array.h: Same.
	* include/bits/atomicity.h: Same.
	* include/bits/stream_iterator.h: Same.
	* include/bits/concurrence.h: Same.
	* include/bits/basic_string.h: Same.
	* include/bits/stl_multimap.h: Same.
	* include/bits/stl_pair.h: Same.
	* include/bits/basic_ios.tcc: Same.
	* include/bits/stl_raw_storage_iter.h: Same.
	* include/bits/stl_vector.h: Same.
	* include/bits/stl_numeric.h: Same.
	* include/bits/ios_base.h: Same.
	* include/bits/stl_deque.h: Same.
	* include/bits/istream.tcc: Same.
	* include/bits/postypes.h: Same.
	* include/bits/stl_multiset.h: Same.
	* include/bits/mask_array.h: Same.
	* include/bits/stl_uninitialized.h: Same.
	* include/bits/ostream.tcc: Same.
	* include/bits/slice_array.h: Same.
	* include/bits/boost_concept_check.h: Same.
	* include/bits/sstream.tcc: Same.
	* include/bits/stl_iterator_base_funcs.h: Same.
	* include/bits/char_traits.h: Same.
	* include/bits/stl_algo.h: Same.
	* include/bits/stringfwd.h: Same.
	* include/bits/c++config
	* include/bits/stl_iterator.h: Same.
	* include/bits/valarray_array.h: Same.
	* include/bits/stl_tempbuf.h: Same.
	* include/bits/vector.tcc: Same.
	* include/bits/deque.tcc: Same.
	* include/bits/stl_bvector.h: Same.
	* include/bits/basic_string.tcc: Same.
	* include/bits/list.tcc: Same.
	* include/bits/streambuf_iterator.h: Same.
	* include/bits/valarray_before.h: Same.
	* include/bits/stl_construct.h: Same.
	* include/bits/stl_function.h: Same.
	* include/bits/cpp_type_traits.h: Same.
	* include/bits/streambuf.tcc: Same.
	* include/bits/allocator.h: Same.
	* include/bits/stl_tree.h: Same.
	* include/bits/fstream.tcc: Same.
	* include/bits/stl_relops.h: Same.
	* include/bits/functexcept.h: Same.
	* include/std/std_valarray.h: Same.
	* include/std/std_iostream.h: Same.
	* include/std/std_streambuf.h: Same.
	* include/std/std_bitset.h: Same.
	* include/std/std_iosfwd.h: Same.
	* include/std/std_iomanip.h: Same.
	* include/std/std_fstream.h: Same.
	* include/std/std_limits.h: Same.
	* include/std/std_stdexcept.h: Same.
	* include/std/std_istream.h: Same.
	* include/std/std_complex.h: Same.
	* include/std/std_memory.h: Same.
	* include/std/std_ostream.h: Same.
	* include/std/std_sstream.h: Same.
	* include/c_std/std_csignal.h: Same.
	* include/c_std/std_cstdlib.h: Same.
	* include/c_std/std_cstdio.h: Same.
	* include/c_std/std_cstdarg.h: Same.
	* include/c_std/std_cctype.h: Same.
	* include/c_std/std_cmath.h: Same.
	* include/c_std/std_ctime.h: Same.
	* include/c_std/std_clocale.h: Same.
	* include/c_std/std_csetjmp.h: Same.
	* include/c_std/std_cwchar.h: Same.
	* include/c_std/std_cstring.h: Same.
	* include/c_std/std_cstddef.h: Same.
	* include/c_std/std_cwctype.h: Same.
	* include/backward/iterator.h: Same.
	* include/backward/set.h: Same.
	* include/backward/hashtable.h: Same.
	* include/backward/fstream.h: Same.
	* include/backward/tempbuf.h: Same.
	* include/backward/istream.h: Same.
	* include/backward/bvector.h: Same.
	* include/backward/stack.h: Same.
	* include/backward/rope.h: Same.
	* include/backward/complex.h: Same.
	* include/backward/ostream.h: Same.
	* include/backward/heap.h: Same.
	* include/backward/iostream.h: Same.
	* include/backward/function.h: Same.
	* include/backward/multimap.h: Same.
	* include/backward/pair.h: Same.
	* include/backward/stream.h: Same.
	* include/backward/iomanip.h: Same.
	* include/backward/strstream
	* include/backward/slist.h: Same.
	* include/backward/tree.h: Same.
	* include/backward/vector.h: Same.
	* include/backward/deque.h: Same.
	* include/backward/multiset.h: Same.
	* include/backward/list.h: Same.
	* include/backward/map.h: Same.
	* include/backward/algobase.h: Same.
	* include/backward/hash_map.h: Same.
	* include/backward/algo.h: Same.
	* include/backward/queue.h: Same.
	* include/backward/streambuf.h: Same.
	* src/allocator-inst.cc: Same.
	* src/complex_io.cc: Same.
	* src/localename.cc: Same.
	* src/limits.cc: Same.
	* src/ios_failure.cc: Same.
	* src/locale-misc-inst.cc: Same.
	* src/streambuf-inst.cc: Same.
	* src/misc-inst.cc: Same.
	* src/concept-inst.cc: Same.
	* src/ios_locale.cc: Same.
	* src/pool_allocator.cc: Same.
	* src/fstream-inst.cc: Same.
	* src/istream-inst.cc: Same.
	* src/string-inst.cc: Same.
	* src/locale_init.cc: Same.
	* src/ctype.cc: Same.
	* src/strstream.cc: Same.
	* src/ostream-inst.cc: Same.
	* src/functexcept.cc: Same.
	* src/streambuf.cc: Same.
	* src/sstream-inst.cc: Same.
	* src/ios.cc: Same.
	* src/valarray-inst.cc: Same.
	* src/locale.cc: Same.
	* src/tree.cc: Same.
	* src/stdexcept.cc: Same.
	* src/istream.cc: Same.
	* src/compatibility.cc: Same.
	* src/locale-inst.cc: Same.
	* src/globals_io.cc: Same.
	* src/list.cc: Same.
	* src/ios_init.cc: Same.
	* src/locale_facets.cc: Same.
	* src/codecvt.cc: Same.

	* include/tr1/unordered_map: Use _GLIBCXX_BEGIN_NAMESPACE(tr1).
	* include/tr1/boost_shared_ptr.h: Same.
	* include/tr1/tuple
	* include/tr1/hashtable
	* include/tr1/type_traits_fwd.h: Same.
	* include/tr1/unordered_set
	* include/tr1/functional
	* include/tr1/ref_fwd.h: Same.
	* include/tr1/utility
	* include/tr1/type_traits
	* include/tr1/array

	* include/ext/hashtable.h: Use _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx).
	* include/ext/typelist.h: Same.
	* include/ext/hash_map: Same.
	* include/ext/rc_string_base.h: Same.
	* include/ext/pool_allocator.h: Same.
	* include/ext/iterator: Same.
	* include/ext/rb_tree: Same.
	* include/ext/numeric: Same.
	* include/ext/vstring.tcc: Same.
	* include/ext/sso_string_base.h: Same.
	* include/ext/stdio_filebuf.h: Same.
	* include/ext/algorithm: Same.
	* include/ext/codecvt_specializations.h: Same.
	* include/ext/new_allocator.h: Same.
	* include/ext/array_allocator.h: Same.
	* include/ext/vstring_util.h: Same.
	* include/ext/vstring_fwd.h: Same.
	* include/ext/mt_allocator.h: Same.
	* include/ext/debug_allocator.h: Same.
	* include/ext/slist: Same.
	* include/ext/stdio_sync_filebuf.h: Same.
	* include/ext/hash_fun.h: Same.
	* include/ext/malloc_allocator.h: Same.
	* include/ext/functional: Same.
	* include/ext/bitmap_allocator.h: Same.
	* include/ext/pod_char_traits.h: Same.
	* include/ext/vstring.h: Same.
	* include/ext/ropeimpl.h: Same.
	* include/ext/hash_set: Same.
	* include/ext/memory: Same.
	* include/ext/rope: Same.
	* include/bits/boost_concept_check.h: Same.
	* include/bits/stl_iterator.h: Same.
	* include/bits/char_traits.h: Same.
	* include/bits/cpp_type_traits.h: Same.
	* include/bits/concurrence.h: Same.
	* include/bits/atomicity.h: Same.
	* config/locale/gnu/numeric_members.cc: Same.
	* config/locale/gnu/collate_members.cc: Same.
	* config/locale/gnu/ctype_members.cc: Same.
	* config/locale/gnu/c_locale.cc: Same.
	* config/locale/gnu/codecvt_members.cc: Same.
	* config/locale/gnu/messages_members.cc: Same.
	* config/locale/gnu/c_locale.h: Same.
	* config/locale/gnu/monetary_members.cc: Same.
	* config/locale/gnu/time_members.cc: Same.
	* config/locale/ieee_1003.1-2001/c_locale.h: Same.
	* config/locale/generic/numeric_members.cc: Same.
	* config/locale/generic/collate_members.cc: Same.
	* config/locale/generic/ctype_members.cc: Same.
	* config/locale/generic/c_locale.cc: Same.
	* config/locale/generic/codecvt_members.cc: Same.
	* config/locale/generic/messages_members.cc: Same.
	* config/locale/generic/c_locale.h: Same.
	* config/locale/generic/monetary_members.cc: Same.
	* config/locale/generic/time_members.cc: Same.
	* config/os/aix/atomicity.h: Same.
	* config/os/irix/atomicity.h: Same.
	* config/cpu/powerpc/atomicity.h: Same.
	* config/cpu/cris/atomicity.h: Same.
	* config/cpu/ia64/atomicity.h: Same.
	* config/cpu/alpha/atomicity.h: Same.
	* config/cpu/m68k/atomicity.h: Same.
	* config/cpu/hppa/atomicity.h: Same.
	* config/cpu/mips/atomicity.h: Same.
	* config/cpu/sparc/atomicity.h: Same.
	* config/cpu/i386/atomicity.h: Same.
	* config/cpu/i486/atomicity.h: Same.
	* config/cpu/sh/atomicity.h: Same.
	* config/cpu/generic/atomicity.h: Same.
	* config/cpu/s390/atomicity.h: Same.
	* config/io/c_io_stdio.h: Same.
	* config/io/basic_file_stdio.cc: Same.
	* config/io/basic_file_stdio.h: Same.	
	* src/misc-inst.cc: Same.
	* src/concept-inst.cc: Same.
	* src/ext-inst.cc: Same.
	* src/string-inst.cc: Same.
	* src/pool_allocator.cc: Same.
	* src/bitmap_allocator.cc: Same.
	* src/mt_allocator.cc: Same.
	* libsupc++/exception: Same.
	* libsupc++/vterminate.cc: Same.
	* testsuite/ext/hash_map/1.cc: Explicitly qualify __gnu_cxx::hash_map.
	* testsuite/ext/hash_map/14648.cc: Same.	

	* libsupc++/eh_alloc.cc: Correct comment line spacing.

From-SVN: r108775
2005-12-19 00:56:05 +00:00
Paolo Carlini b6105bf2c3 sso_string_base.h (__sso_string_base<>::_M_compare): Add...
2005-12-10  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_compare):
	Add, specialized for char and wchar_t to immediately return true
	when a string is compared to itself.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_compare):
	Likewise, for the same _Rep.
	* include/ext/vstring.h (compare(const string&)): Use it.

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_destroy):
	Deallocate passed size + 1.
	(_M_dispose, _M_reserve): Adjust.

From-SVN: r108372
2005-12-11 00:41:29 +00:00
Paolo Carlini afe6d70550 sso_string_base.h (__sso_string_base<>::_M_assign): Simplify, avoid pointless reallocations.
2005-12-05  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_assign):
	Simplify, avoid pointless reallocations.

From-SVN: r108063
2005-12-05 16:39:18 +00:00
Paolo Carlini 56540d20c2 sso_string_base.h (__sso_string_base<>::_M_reserve): Simplify.
2005-12-04  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_reserve):
	Simplify.

From-SVN: r108036
2005-12-05 01:57:59 +00:00
Paolo Carlini cf8829194f vstring.h (__versa_string<>::operator+, [...]): Move out of line...
2005-12-04  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/vstring.h (__versa_string<>::operator+, all
	versions): Move out of line...
	* include/ext/vstring.tcc (__versa_string<>::operator+): ...
	here; consistently use reserve for the benefit of sso_string_base;
	prefer push_back to single-char append when appropriate.

	* include/ext/vstring.h (__versa_string<>::push_back): Don't
	call _M_reserve, _M_mutate instead.
	(reserve): Just forward to _M_reserve.
	* include/ext/vstring.tcc (__versa_string<>::_M_reserve): Remove.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_reserve): Also
	do the initial checks (first on length, in case __res == capacity).
	* include/ext/sso_string_base.h (__sso_string_base<>::_M_reserve:
	Likewise; don't call _M_set_length unnecessarily.

2005-12-04  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/vstring.h (__versa_string<>::_M_append): New.
	(append(const __versa_string&), append(const __versa_string&,
	size_type, size_type), append(const _CharT*, size_type),
	append(const _CharT*)): Use it.
	(append(size_type, _CharT)): Delegate to _M_replace_aux.
	(assign(const __versa_string&, size_type, size_type),
	assign(const _CharT*), replace(size_type, size_type,
	const _CharT*, size_type)): Forward to _M_replace.
	* include/ext/vstring.tcc (__versa_string<>::_M_append):
	Define, core append functionality.
	(_M_replace): Simplify, move __s == 0 case to _M_replace_aux.
	(_M_replace_aux): Reorganize, don't call _M_replace.

2005-12-04  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/vstring.tcc (__versa_string<>::_M_replace):
	Perform _M_check_length at the beginning and remove it from ...
	(replace, _M_replace_dispatch, _M_replace_aux, assign): ... here.
	(assign): Now move inline.
	(resize): Don't call _M_check_length redundantly, append does.

2005-12-04  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_get_allocator):
	Add non const version.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_get_allocator):
	Likewise.
	
	* include/ext/sso_string_base.h (__sso_string_base<>::_M_erase): Add.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_erase): Likewise.
	(_M_leak_hard): Use it.
	* include/ext/vstring.h (__versa_string<>::clear, erase, all
	versions): Use it.
	* include/ext/vstring.tcc (__versa_string<>::resize): Likewise.

	* include/ext/vstring.h (__versa_string<>::_M_replace_safe):
	Remove.
	* include/ext/vstring.h (__versa_string<>::_M_replace): New, does
	the in-place work or delegates to _M_mutate in case of reallocation.
	* include/ext/vstring.tcc (__versa_string<>::_M_replace_safe):
	Remove.
	* include/ext/vstring.tcc (__versa_string<>::_M_replace): Define.
	(assign, replace, _M_replace_dispatch, _M_replace_aux): Use it.
	* include/ext/sso_string_base.h (__sso_string_base<>::_M_mutate):
	Change to manage only reallocations.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_mutate):
	Likewise.

	* include/ext/vstring.h (__versa_string<>::insert(size_type,
	const __versa_string&), insert(size_type, const __versa_string&,
	size_type, size_type), insert(size_type, const _CharT*, size_type),
	insert(size_type, const _CharT*)): Delegate to replace.

	* include/ext/vstring.h (__versa_string<>::reserve): Move out of
	line.
	* include/ext/vstring.tcc (__versa_string<>::reserve): Do the
	checks and call _M_reserve.
	* include/ext/vstring.h (__versa_string<>::append): Call _M_reserve
	instead of reserve.
	* include/ext/vstring.tcc (__versa_string<>::append, all versions):
	Likewise.
	* include/ext/sso_string_base.h (__sso_string_base<>::_M_reserve):
	Adjust.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_reserve):
	Likewise.

From-SVN: r108034
2005-12-05 00:32:31 +00:00
Paolo Carlini b6cb8dc2d8 sso_string_base.h: Minor formatting and stylistic fixes.
2005-11-21  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h: Minor formatting and stylistic fixes.
	(__sso_string_base<>::_M_get_allocator): Return by const ref.
	* include/ext/rc_string_base.h: Likewise.
	(__rc_string_base<>::_M_get_allocator): Return by const ref.
	(__rc_string_base<>::_M_dispose): Take void, use _M_get_allocator.
	(__rc_string_base<>::_M_grab): Take one alloc, use _M_get_allocator.
	(__rc_string_base<>::~__rc_string_base,
	__rc_string_base(const __rc_string_base&), _M_assign, _M_reserve,
	_M_mutate): Adjust.
	* include/ext/vstring_util.h: Minor stylistic fixes.

From-SVN: r107317
2005-11-21 18:38:05 +00:00
Paolo Carlini 7697e6c66a rc_string_base.h (__rc_string_base<>::_Rep): Avoid the anonymous struct extension, adjust everywhere.
2005-11-18  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/rc_string_base.h (__rc_string_base<>::_Rep): Avoid the
	anonymous struct extension, adjust everywhere.

	* include/ext/rc_string_base.h (__rc_string_base<>::_S_empty_rep()):
	Just use a static member.
	(__rc_string_base<>::__rc_string_base(), _S_construct): Adjust.

	* include/ext/rc_string_base.h (__rc_string_base<>::_Rep): Use anonymous
	union together with _CharT to fix alignment issues, rebind to _Rep and
	rename _Raw_alloc to _Rep_alloc_type.
	(__rc_string_base<>::_Rep::_S_create, _M_destroy): Adjust consistently.

	* include/ext/vstring_util.h (__is_null_p): Move inside struct
	__vstring_utility as static _S_is_null_pointer.
	* include/ext/sso_string.h
	(__sso_string_base<>::_M_construct(std::forward_iterator_tag): Adjust.
	* include/ext/rc_string_base.h
	(__rc_string_base<>::_S_construct(std::forward_iterator_tag): Likewise.

	Implement Option 3 of DR 431 for ext/vstring - both available bases.
	* include/bits/cpp_type_traits.h (struct __is_empty): Add.
	* include/ext/vstring.h (__versa_string<>::swap): Delegate to
	this->_M_swap.
	* include/ext/vstring.tcc (__versa_string<>::swap): Remove.
	* include/ext/vstring_util.h (struct __vstring_utility<>): Add struct
	_Alloc_hider<>, augmented of allocator swapping facility, specialized
	to nop for empty allocators.
	* include/ext/rc_string_base.h (__rc_string_base<>::_M_swap): Use it.
	(__rc_string_base<>::_M_is_leaked, _M_set_sharable): Change to private.
	* include/ext/sso_string_base.h	(__sso_string_base<>::_M_swap):
	Likewise.
	(__sso_string_base<>::_M_is_leaked, _M_set_sharable): Remove, unused.	

	* include/ext/rc_string_base.h (__rc_string_base<>::_M_data(_CharT*):
	Return void.
	* include/ext/sso_string_base.h (__sso_string_base<>::_M_data(_CharT*):
	Likewise.

From-SVN: r107176
2005-11-18 11:50:22 +00:00
Paolo Carlini f9c4ee6d10 sso_string_base.h (__sso_string_base<>::_M_swap): Change the various traits_type::copy call to always copy the entire local buffer...
2005-11-03  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (__sso_string_base<>::_M_swap):
	Change the various traits_type::copy call to always copy the
	entire local buffer; return early and don't do a full swap on
	the lengths for two common cases; change two _S_copy to plain
	traits_type::copy.

From-SVN: r106431
2005-11-03 13:13:21 +00:00
Paolo Carlini 7058c3be1a sso_string_base.h (_M_swap): Rewrite.
2005-10-19  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (_M_swap): Rewrite.

From-SVN: r105654
2005-10-20 01:07:13 +00:00
Paolo Carlini 486516b60b rc_string_base.h (_S_terminal): Remove.
2005-10-19  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/rc_string_base.h (_S_terminal): Remove.
	(_M_set_length): Adjust.
	(_S_max_size): Change to anonymous enum.
	(_M_max_size()): Add, returns the latter.
	* include/ext/sso_string_base.h: Likewise.
	* include/ext/vstring.h (max_size): Adjust.

From-SVN: r105616
2005-10-19 14:25:31 +00:00
Paolo Carlini c54c1b2b52 sso_string_base.h (struct __sso_string_local): Remove...
2005-10-05  Paolo Carlini  <pcarlini@suse.de>

	* include/ext/sso_string_base.h (struct __sso_string_local):
	Remove, actually POD types cannot have user defined constructors
	(being aggregates) and therefore can always be members of unions.
	(class __sso_string_base): Adjust consistently.

From-SVN: r105021
2005-10-05 23:50:18 +00:00
Kelley Cook 83f517994d All files: Update FSF address.
2005-08-17  Kelley Cook  <kcook@gcc.gnu.org>

	* All files: Update FSF address.

From-SVN: r103192
2005-08-17 02:28:44 +00:00
Paolo Carlini 872d8fea40 Add class __versa_string, a versatile "basic_string-type" class...
2005-07-05  Paolo Carlini  <pcarlini@suse.de>

	Add class __versa_string, a versatile "basic_string-type" class:
	an additional, non-standard, template parameter allows to specify
	the preferred base class. Two are provided: __rc_string_base,
	which implements a behavior very similar to our standard string,
	and __sso_string_base, not reference-counted and optimized for
	short strings.
	* include/ext/rc_string_base.h: New.
	* include/ext/sso_string_base.h: Likewise.
	* include/ext/vstring.h: Likewise.
	* include/ext/vstring.tcc: Likewise.
	* include/ext/vstring_fwd.h: Likewise.
	* include/ext/vstring_util.h: Likewise.
	* include/Makefile.am: Add.
	* include/Makefile.in: Regenerate.
	* testsuite/ext/vstring/explicit_instantiation/1.cc: New.
	* testsuite/ext/vstring/explicit_instantiation/2.cc: Likewise.
	* testsuite/ext/vstring/explicit_instantiation/char/1.cc: Likewise.
	* testsuite/ext/vstring/explicit_instantiation/wchar_t/1.cc: Likewise.

	* Makefile.in: Regenerate with autotools 1.9.3 (to date, the version
	officially used by v3).
	* aclocal.m4: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* po/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.

From-SVN: r101639
2005-07-05 23:07:18 +00:00