mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-15 06:54:05 +08:00
basic_string.h (operator+=(initializer_list<>), [...]): Forward to the append overload taking a const CharT* pointer and a size...
2009-10-14 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/basic_string.h (operator+=(initializer_list<>), append(initializer_list<>)): Forward to the append overload taking a const CharT* pointer and a size, thus avoiding instantiating unnecessarily in the built library the overload taking a pair of iterators. (operator=(initializer_list<>), assign(initializer_list<>)): Likewise for assign. (insert(iterator, initializer_list<>): Likewise for insert. From-SVN: r152794
This commit is contained in:
parent
b2b5d6e34d
commit
5cab701369
@ -1,3 +1,14 @@
|
||||
2009-10-14 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/basic_string.h (operator+=(initializer_list<>),
|
||||
append(initializer_list<>)): Forward to the append overload taking
|
||||
a const CharT* pointer and a size, thus avoiding instantiating
|
||||
unnecessarily in the built library the overload taking a pair of
|
||||
iterators.
|
||||
(operator=(initializer_list<>), assign(initializer_list<>)): Likewise
|
||||
for assign.
|
||||
(insert(iterator, initializer_list<>): Likewise for insert.
|
||||
|
||||
2009-10-14 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/bits/c++config: Do not disable extern templates for string
|
||||
|
@ -540,7 +540,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
basic_string&
|
||||
operator=(initializer_list<_CharT> __l)
|
||||
{
|
||||
this->assign (__l.begin(), __l.end());
|
||||
this->assign(__l.begin(), __l.size());
|
||||
return *this;
|
||||
}
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
@ -860,7 +860,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
*/
|
||||
basic_string&
|
||||
operator+=(initializer_list<_CharT> __l)
|
||||
{ return this->append(__l.begin(), __l.end()); }
|
||||
{ return this->append(__l.begin(), __l.size()); }
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
/**
|
||||
@ -926,7 +926,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
*/
|
||||
basic_string&
|
||||
append(initializer_list<_CharT> __l)
|
||||
{ return this->append(__l.begin(), __l.end()); }
|
||||
{ return this->append(__l.begin(), __l.size()); }
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
/**
|
||||
@ -1045,7 +1045,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
*/
|
||||
basic_string&
|
||||
assign(initializer_list<_CharT> __l)
|
||||
{ return this->assign(__l.begin(), __l.end()); }
|
||||
{ return this->assign(__l.begin(), __l.size()); }
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
/**
|
||||
@ -1089,7 +1089,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
|
||||
*/
|
||||
void
|
||||
insert(iterator __p, initializer_list<_CharT> __l)
|
||||
{ this->insert(__p, __l.begin(), __l.end()); }
|
||||
{
|
||||
_GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
|
||||
this->insert(__p - _M_ibegin(), __l.begin(), __l.size());
|
||||
}
|
||||
#endif // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user