Commit 5cab7013 by Paolo Carlini Committed by Paolo Carlini

basic_string.h (operator+=(initializer_list<>), [...]): Forward to the append…

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
parent b2b5d6e3
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
in plain parallel-mode and in profile-mode; add comment explaining
_GLIBCXX_EXTERN_TEMPLATE == -1.
......
......@@ -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__
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment