diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2010-01-10 16:15:58 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2010-01-10 16:15:58 +0000 |
commit | 8b6f089bcbf20653a5a0e85d4390fe3b74e21bfc (patch) | |
tree | 206492a8b88b5f966cbe174d1bc0ad1279b67fde /libstdc++-v3 | |
parent | baa828a01d3f83b712dc02bcf86cd9c036c911fb (diff) | |
download | gcc-8b6f089bcbf20653a5a0e85d4390fe3b74e21bfc.zip gcc-8b6f089bcbf20653a5a0e85d4390fe3b74e21bfc.tar.gz gcc-8b6f089bcbf20653a5a0e85d4390fe3b74e21bfc.tar.bz2 |
string (basic_string<>::basic_string(basic_string&&), [...]): Add.
2010-01-10 Paolo Carlini <paolo.carlini@oracle.com>
* include/debug/string (basic_string<>::basic_string(basic_string&&),
operator=(basic_string&&), assign(basic_string&&)): Add.
* include/debug/string: Fully qualify initializer_list with std; fix
_Allocator misspellings as _Alloc.
From-SVN: r155790
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/debug/string | 35 |
2 files changed, 37 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 30b09e1..e136e64 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,13 @@ 2010-01-10 Paolo Carlini <paolo.carlini@oracle.com> + * include/debug/string (basic_string<>::basic_string(basic_string&&), + operator=(basic_string&&), assign(basic_string&&)): Add. + + * include/debug/string: Fully qualify initializer_list with std; fix + _Allocator misspellings as _Alloc. + +2010-01-10 Paolo Carlini <paolo.carlini@oracle.com> + * include/bits/basic_string.h (basic_string<>:: basic_string(basic_string&&), operator=(basic_string&&), assign(basic_string&&)): Add. diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string index 607d961..160488e 100644 --- a/libstdc++-v3/include/debug/string +++ b/libstdc++-v3/include/debug/string @@ -112,7 +112,12 @@ namespace __gnu_debug { } #ifdef __GXX_EXPERIMENTAL_CXX0X__ - basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) + basic_string(basic_string&& __str) + : _Base(std::forward<_Base>(__str)) + { } + + basic_string(std::initializer_list<_CharT> __l, + const _Allocator& __a = _Allocator()) : _Base(__l, __a) { } #endif // __GXX_EXPERIMENTAL_CXX0X__ @@ -146,7 +151,15 @@ namespace __gnu_debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ basic_string& - operator=(initializer_list<_CharT> __l) + operator=(basic_string&& __str) + { + *static_cast<_Base*>(this) = std::forward<_Base>(__str); + this->_M_invalidate_all(); + return *this; + } + + basic_string& + operator=(std::initializer_list<_CharT> __l) { *static_cast<_Base*>(this) = __l; this->_M_invalidate_all(); @@ -277,7 +290,7 @@ namespace __gnu_debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ basic_string& - operator+=(initializer_list<_CharT> __l) + operator+=(std::initializer_list<_CharT> __l) { _M_base() += __l; this->_M_invalidate_all(); @@ -354,6 +367,16 @@ namespace __gnu_debug return *this; } +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + basic_string& + assign(basic_string&& __x) + { + _Base::assign(std::forward<_Base>(__x)); + this->_M_invalidate_all(); + return *this; + } +#endif // __GXX_EXPERIMENTAL_CXX0X__ + basic_string& assign(const basic_string& __str, size_type __pos, size_type __n) { @@ -400,7 +423,7 @@ namespace __gnu_debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ basic_string& - assign(initializer_list<_CharT> __l) + assign(std::initializer_list<_CharT> __l) { _Base::assign(__l); this->_M_invalidate_all(); @@ -479,7 +502,7 @@ namespace __gnu_debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ void - insert(iterator __p, initializer_list<_CharT> __l) + insert(iterator __p, std::initializer_list<_CharT> __l) { _Base::insert(__p, __l); this->_M_invalidate_all(); @@ -611,7 +634,7 @@ namespace __gnu_debug #ifdef __GXX_EXPERIMENTAL_CXX0X__ basic_string& replace(iterator __i1, iterator __i2, - initializer_list<_CharT> __l) + std::initializer_list<_CharT> __l) { __glibcxx_check_erase_range(__i1, __i2); _Base::replace(__i1.base(), __i2.base(), __l); |