diff options
author | Paolo Carlini <pcarlini@suse.de> | 2005-11-18 11:50:22 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2005-11-18 11:50:22 +0000 |
commit | 7697e6c66a562e9bf4ef55898934079137197e2e (patch) | |
tree | a5bf3fa64144b286d112a9a48c5f870a8aa71dc0 /libstdc++-v3/include/ext/vstring.tcc | |
parent | e0709888ef53405b609913dfe1c9bd4ff0ec750e (diff) |
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
Diffstat (limited to 'libstdc++-v3/include/ext/vstring.tcc')
-rw-r--r-- | libstdc++-v3/include/ext/vstring.tcc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/libstdc++-v3/include/ext/vstring.tcc b/libstdc++-v3/include/ext/vstring.tcc index b8d35e3aceb..76fa96bcbd3 100644 --- a/libstdc++-v3/include/ext/vstring.tcc +++ b/libstdc++-v3/include/ext/vstring.tcc @@ -222,30 +222,6 @@ namespace __gnu_cxx template <typename, typename, typename> class _Base> void __versa_string<_CharT, _Traits, _Alloc, _Base>:: - swap(__versa_string& __s) - { - if (this->_M_is_leaked()) - this->_M_set_sharable(); - if (__s._M_is_leaked()) - __s._M_set_sharable(); - if (this->get_allocator() == __s.get_allocator()) - this->_M_swap(__s); - // The code below can usually be optimized away. - else - { - const __versa_string __tmp1(_M_ibegin(), _M_iend(), - __s.get_allocator()); - const __versa_string __tmp2(__s._M_ibegin(), __s._M_iend(), - this->get_allocator()); - *this = __tmp2; - __s = __tmp1; - } - } - - template<typename _CharT, typename _Traits, typename _Alloc, - template <typename, typename, typename> class _Base> - void - __versa_string<_CharT, _Traits, _Alloc, _Base>:: resize(size_type __n, _CharT __c) { const size_type __size = this->size(); |