forked from boostorg/static_string
Code reorganization
This commit is contained in:
@ -2026,7 +2026,11 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
append(
|
append(
|
||||||
InputIterator first,
|
InputIterator first,
|
||||||
InputIterator last);
|
InputIterator last)
|
||||||
|
{
|
||||||
|
this->set_size(size() + read_back(true, first, last));
|
||||||
|
return term();
|
||||||
|
}
|
||||||
|
|
||||||
/** Append to the string.
|
/** Append to the string.
|
||||||
|
|
||||||
@ -2430,7 +2434,12 @@ public:
|
|||||||
copy(
|
copy(
|
||||||
pointer dest,
|
pointer dest,
|
||||||
size_type count,
|
size_type count,
|
||||||
size_type pos = 0) const;
|
size_type pos = 0) const
|
||||||
|
{
|
||||||
|
const auto num_copied = capped_length(pos, count);
|
||||||
|
traits_type::copy(dest, data() + pos, num_copied);
|
||||||
|
return num_copied;
|
||||||
|
}
|
||||||
|
|
||||||
/** Change the size of the string.
|
/** Change the size of the string.
|
||||||
|
|
||||||
@ -4120,7 +4129,12 @@ private:
|
|||||||
basic_static_string&
|
basic_static_string&
|
||||||
assign_unchecked(
|
assign_unchecked(
|
||||||
const_pointer s,
|
const_pointer s,
|
||||||
size_type count) noexcept;
|
size_type count) noexcept
|
||||||
|
{
|
||||||
|
this->set_size(count);
|
||||||
|
traits_type::copy(data(), s, size() + 1);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||||
size_type
|
size_type
|
||||||
@ -4486,7 +4500,7 @@ operator<<(
|
|||||||
std::basic_ostream<CharT, Traits>& os,
|
std::basic_ostream<CharT, Traits>& os,
|
||||||
const basic_static_string<N, CharT, Traits>& s)
|
const basic_static_string<N, CharT, Traits>& s)
|
||||||
{
|
{
|
||||||
return os << boost::static_string::basic_string_view<CharT, Traits>(s.data(), s.size());
|
return os << basic_string_view<CharT, Traits>(s.data(), s.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -4954,34 +4968,6 @@ append(
|
|||||||
return term();
|
return term();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t N, typename CharT, typename Traits>
|
|
||||||
template<typename InputIterator>
|
|
||||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
||||||
auto
|
|
||||||
basic_static_string<N, CharT, Traits>::
|
|
||||||
append(
|
|
||||||
InputIterator first,
|
|
||||||
InputIterator last) ->
|
|
||||||
typename std::enable_if<
|
|
||||||
detail::is_input_iterator<InputIterator>::value,
|
|
||||||
basic_static_string&>::type
|
|
||||||
{
|
|
||||||
this->set_size(size() + read_back(true, first, last));
|
|
||||||
return term();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<std::size_t N, typename CharT, typename Traits>
|
|
||||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
||||||
auto
|
|
||||||
basic_static_string<N, CharT, Traits>::
|
|
||||||
copy(pointer dest, size_type count, size_type pos) const ->
|
|
||||||
size_type
|
|
||||||
{
|
|
||||||
const auto num_copied = capped_length(pos, count);
|
|
||||||
traits_type::copy(dest, data() + pos, num_copied);
|
|
||||||
return num_copied;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<std::size_t N, typename CharT, typename Traits>
|
template<std::size_t N, typename CharT, typename Traits>
|
||||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||||
void
|
void
|
||||||
@ -5347,21 +5333,6 @@ insert_unchecked(
|
|||||||
this->set_size(curr_size + count);
|
this->set_size(curr_size + count);
|
||||||
return curr_data + index;
|
return curr_data + index;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<std::size_t N, typename CharT, typename Traits>
|
|
||||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
||||||
auto
|
|
||||||
basic_static_string<N, CharT, Traits>::
|
|
||||||
assign_unchecked(
|
|
||||||
const_pointer s,
|
|
||||||
size_type count) noexcept ->
|
|
||||||
basic_static_string&
|
|
||||||
{
|
|
||||||
this->set_size(count);
|
|
||||||
traits_type::copy(data(), s, size() + 1);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // static_string
|
} // static_string
|
||||||
} // boost
|
} // boost
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user