|
@@ -926,6 +926,8 @@ public:
|
|
|
basic_string& append(const value_type* __s, size_type __n);
|
|
|
basic_string& append(const value_type* __s);
|
|
|
basic_string& append(size_type __n, value_type __c);
|
|
|
+ template <class _ForwardIterator>
|
|
|
+ basic_string& __append_forward_unsafe(_ForwardIterator, _ForwardIterator);
|
|
|
template<class _InputIterator>
|
|
|
typename enable_if
|
|
|
<
|
|
@@ -933,7 +935,12 @@ public:
|
|
|
|| !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
|
|
|
basic_string&
|
|
|
>::type
|
|
|
- append(_InputIterator __first, _InputIterator __last);
|
|
|
+ _LIBCPP_INLINE_VISIBILITY
|
|
|
+ append(_InputIterator __first, _InputIterator __last) {
|
|
|
+ const basic_string __temp (__first, __last, __alloc());
|
|
|
+ append(__temp.data(), __temp.size());
|
|
|
+ return *this;
|
|
|
+ }
|
|
|
template<class _ForwardIterator>
|
|
|
typename enable_if
|
|
|
<
|
|
@@ -941,7 +948,11 @@ public:
|
|
|
&& __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
|
|
|
basic_string&
|
|
|
>::type
|
|
|
- append(_ForwardIterator __first, _ForwardIterator __last);
|
|
|
+ _LIBCPP_INLINE_VISIBILITY
|
|
|
+ append(_ForwardIterator __first, _ForwardIterator __last) {
|
|
|
+ return __append_forward_unsafe(__first, __last);
|
|
|
+ }
|
|
|
+
|
|
|
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
|
_LIBCPP_INLINE_VISIBILITY
|
|
|
basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
|
|
@@ -2182,21 +2193,6 @@ basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
|
|
|
traits_type::assign(*++__p, value_type());
|
|
|
}
|
|
|
|
|
|
-template <class _CharT, class _Traits, class _Allocator>
|
|
|
-template<class _InputIterator>
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- __is_exactly_input_iterator<_InputIterator>::value
|
|
|
- || !__libcpp_string_gets_noexcept_iterator<_InputIterator>::value,
|
|
|
- basic_string<_CharT, _Traits, _Allocator>&
|
|
|
->::type
|
|
|
-basic_string<_CharT, _Traits, _Allocator>::append(_InputIterator __first, _InputIterator __last)
|
|
|
-{
|
|
|
- const basic_string __temp (__first, __last, __alloc());
|
|
|
- append(__temp.data(), __temp.size());
|
|
|
- return *this;
|
|
|
-}
|
|
|
-
|
|
|
template <class _Tp>
|
|
|
bool __ptr_in_range (const _Tp* __p, const _Tp* __first, const _Tp* __last)
|
|
|
{
|
|
@@ -2211,14 +2207,12 @@ bool __ptr_in_range (const _Tp1* __p, const _Tp2* __first, const _Tp2* __last)
|
|
|
|
|
|
template <class _CharT, class _Traits, class _Allocator>
|
|
|
template<class _ForwardIterator>
|
|
|
-typename enable_if
|
|
|
-<
|
|
|
- __is_forward_iterator<_ForwardIterator>::value
|
|
|
- && __libcpp_string_gets_noexcept_iterator<_ForwardIterator>::value,
|
|
|
- basic_string<_CharT, _Traits, _Allocator>&
|
|
|
->::type
|
|
|
-basic_string<_CharT, _Traits, _Allocator>::append(_ForwardIterator __first, _ForwardIterator __last)
|
|
|
+basic_string<_CharT, _Traits, _Allocator>&
|
|
|
+basic_string<_CharT, _Traits, _Allocator>::__append_forward_unsafe(
|
|
|
+ _ForwardIterator __first, _ForwardIterator __last)
|
|
|
{
|
|
|
+ static_assert(__is_forward_iterator<_ForwardIterator>::value,
|
|
|
+ "function requires a ForwardIterator");
|
|
|
size_type __sz = size();
|
|
|
size_type __cap = capacity();
|
|
|
size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
|