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:
Paolo Carlini 2009-10-15 01:16:53 +00:00 committed by Paolo Carlini
parent b2b5d6e34d
commit 5cab701369
2 changed files with 19 additions and 5 deletions

View File

@ -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

View File

@ -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__
/**