forked from boostorg/static_string
Consistent whitespace
This commit is contained in:
@ -34,16 +34,20 @@ class basic_static_string;
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<std::size_t N>
|
||||
using static_string = basic_static_string<N, char, std::char_traits<char>>;
|
||||
using static_string =
|
||||
basic_static_string<N, char, std::char_traits<char>>;
|
||||
|
||||
template<std::size_t N>
|
||||
using static_wstring = basic_static_string<N, wchar_t, std::char_traits<wchar_t>>;
|
||||
using static_wstring =
|
||||
basic_static_string<N, wchar_t, std::char_traits<wchar_t>>;
|
||||
|
||||
template<std::size_t N>
|
||||
using static_u16string = basic_static_string<N, char16_t, std::char_traits<char16_t>>;
|
||||
using static_u16string =
|
||||
basic_static_string<N, char16_t, std::char_traits<char16_t>>;
|
||||
|
||||
template<std::size_t N>
|
||||
using static_u32string = basic_static_string<N, char32_t, std::char_traits<char32_t>>;
|
||||
using static_u32string =
|
||||
basic_static_string<N, char32_t, std::char_traits<char32_t>>;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
@ -137,7 +141,9 @@ struct is_subtractable<T, void_t<decltype(std::declval<T&>() - std::declval<T&>(
|
||||
: std::true_type { };
|
||||
|
||||
// constexpr distance for c++14
|
||||
template<typename ForwardIt, typename std::enable_if<!is_subtractable<ForwardIt>::value>::type* = nullptr>
|
||||
template<
|
||||
typename ForwardIt,
|
||||
typename std::enable_if<!is_subtractable<ForwardIt>::value>::type* = nullptr>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
std::size_t
|
||||
distance(ForwardIt first, ForwardIt last)
|
||||
@ -147,7 +153,9 @@ distance(ForwardIt first, ForwardIt last)
|
||||
return dist;
|
||||
}
|
||||
|
||||
template<typename RandomIt, typename std::enable_if<is_subtractable<RandomIt>::value>::type* = nullptr>
|
||||
template<
|
||||
typename RandomIt,
|
||||
typename std::enable_if<is_subtractable<RandomIt>::value>::type* = nullptr>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
std::size_t
|
||||
distance(RandomIt first, RandomIt last)
|
||||
@ -159,7 +167,10 @@ distance(RandomIt first, RandomIt last)
|
||||
template<typename Traits, typename InputIt, typename CharT>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
void
|
||||
copy_with_traits(InputIt first, InputIt last, CharT* out)
|
||||
copy_with_traits(
|
||||
InputIt first,
|
||||
InputIt last,
|
||||
CharT* out)
|
||||
{
|
||||
for (; first != last; ++first, ++out)
|
||||
Traits::assign(*out, *first);
|
||||
@ -274,8 +285,10 @@ BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
inline
|
||||
int
|
||||
lexicographical_compare(
|
||||
CharT const* s1, std::size_t n1,
|
||||
CharT const* s2, std::size_t n2) noexcept
|
||||
CharT const* s1,
|
||||
std::size_t n1,
|
||||
CharT const* s2,
|
||||
std::size_t n2) noexcept
|
||||
{
|
||||
if(n1 < n2)
|
||||
return Traits::compare(
|
||||
@ -292,7 +305,8 @@ inline
|
||||
int
|
||||
lexicographical_compare(
|
||||
basic_string_view<CharT, Traits> s1,
|
||||
CharT const* s2, std::size_t n2) noexcept
|
||||
CharT const* s2,
|
||||
std::size_t n2) noexcept
|
||||
{
|
||||
return detail::lexicographical_compare<
|
||||
CharT, Traits>(s1.data(), s1.size(), s2, n2);
|
||||
@ -304,7 +318,8 @@ inline
|
||||
int
|
||||
lexicographical_compare(
|
||||
const basic_static_string<N, CharT, Traits>& s1,
|
||||
CharT const* s2, std::size_t n2) noexcept
|
||||
CharT const* s2,
|
||||
std::size_t n2) noexcept
|
||||
{
|
||||
return detail::lexicographical_compare<
|
||||
CharT, Traits>(s1.data(), s1.size(), s2, n2);
|
||||
@ -338,7 +353,9 @@ template<typename Traits, typename Integer>
|
||||
inline
|
||||
char*
|
||||
integer_to_string(
|
||||
char* str_end, Integer value, std::true_type) noexcept
|
||||
char* str_end,
|
||||
Integer value,
|
||||
std::true_type) noexcept
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
@ -362,7 +379,9 @@ template<typename Traits, typename Integer>
|
||||
inline
|
||||
char*
|
||||
integer_to_string(
|
||||
char* str_end, Integer value, std::false_type) noexcept
|
||||
char* str_end,
|
||||
Integer value,
|
||||
std::false_type) noexcept
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
@ -378,7 +397,9 @@ template<typename Traits, typename Integer>
|
||||
inline
|
||||
wchar_t*
|
||||
integer_to_wstring(
|
||||
wchar_t* str_end, Integer value, std::true_type) noexcept
|
||||
wchar_t* str_end,
|
||||
Integer value,
|
||||
std::true_type) noexcept
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
@ -402,7 +423,9 @@ template<typename Traits, typename Integer>
|
||||
inline
|
||||
wchar_t*
|
||||
integer_to_wstring(
|
||||
wchar_t* str_end, Integer value, std::false_type) noexcept
|
||||
wchar_t* str_end,
|
||||
Integer value,
|
||||
std::false_type) noexcept
|
||||
{
|
||||
if (value == 0)
|
||||
{
|
||||
@ -486,10 +509,7 @@ to_static_wstring_float_impl(long double value) noexcept
|
||||
return static_wstring<N>(buffer);
|
||||
}
|
||||
|
||||
template<
|
||||
typename Traits,
|
||||
typename CharT,
|
||||
typename ForwardIterator>
|
||||
template<typename Traits, typename CharT, typename ForwardIterator>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
inline
|
||||
ForwardIterator
|
||||
@ -506,10 +526,7 @@ find_not_of(
|
||||
}
|
||||
|
||||
// constexpr search for C++14
|
||||
template<
|
||||
typename ForwardIt1,
|
||||
typename ForwardIt2,
|
||||
typename BinaryPredicate>
|
||||
template<typename ForwardIt1, typename ForwardIt2, typename BinaryPredicate>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
inline
|
||||
ForwardIt1
|
||||
@ -535,10 +552,7 @@ search(
|
||||
}
|
||||
}
|
||||
|
||||
template<
|
||||
typename InputIt,
|
||||
typename ForwardIt,
|
||||
typename BinaryPredicate>
|
||||
template<typename InputIt, typename ForwardIt, typename BinaryPredicate>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
inline
|
||||
InputIt
|
||||
@ -618,9 +632,7 @@ ptr_in_range(
|
||||
|
||||
@see to_static_string
|
||||
*/
|
||||
template<
|
||||
std::size_t N,
|
||||
typename CharT,
|
||||
template<std::size_t N, typename CharT,
|
||||
typename Traits = std::char_traits<CharT>>
|
||||
class basic_static_string
|
||||
#ifndef GENERATING_DOCUMENTATION
|
||||
@ -736,8 +748,7 @@ public:
|
||||
Construct from a null terminated string.
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string(
|
||||
CharT const* s);
|
||||
basic_static_string(CharT const* s);
|
||||
|
||||
/** Construct a `basic_static_string`.
|
||||
|
||||
@ -760,8 +771,7 @@ public:
|
||||
Copy constructor.
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string(
|
||||
basic_static_string const& other) noexcept;
|
||||
basic_static_string(basic_static_string const& other) noexcept;
|
||||
|
||||
/** Construct a `basic_static_string`.
|
||||
|
||||
@ -777,8 +787,7 @@ public:
|
||||
Construct from an initializer list
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string(
|
||||
std::initializer_list<CharT> init);
|
||||
basic_static_string(std::initializer_list<CharT> init);
|
||||
|
||||
/** Construct a `basic_static_string`.
|
||||
|
||||
@ -786,8 +795,7 @@ public:
|
||||
*/
|
||||
explicit
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string(
|
||||
string_view_type sv);
|
||||
basic_static_string(string_view_type sv);
|
||||
|
||||
/** Construct a `basic_static_string`.
|
||||
|
||||
@ -822,8 +830,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
operator=(
|
||||
basic_static_string const& s) noexcept
|
||||
operator=(basic_static_string const& s) noexcept
|
||||
{
|
||||
return assign(s);
|
||||
}
|
||||
@ -837,8 +844,7 @@ public:
|
||||
template<std::size_t M>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
operator=(
|
||||
basic_static_string<M, CharT, Traits> const& s)
|
||||
operator=(basic_static_string<M, CharT, Traits> const& s)
|
||||
{
|
||||
return assign(s);
|
||||
}
|
||||
@ -851,8 +857,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
operator=(
|
||||
CharT const* s)
|
||||
operator=(CharT const* s)
|
||||
{
|
||||
return assign(s);
|
||||
}
|
||||
@ -863,8 +868,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
operator=(
|
||||
CharT ch)
|
||||
operator=(CharT ch)
|
||||
{
|
||||
return assign_char(ch,
|
||||
std::integral_constant<bool, (N > 0)>{});
|
||||
@ -876,8 +880,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
operator=(
|
||||
std::initializer_list<CharT> ilist)
|
||||
operator=(std::initializer_list<CharT> ilist)
|
||||
{
|
||||
return assign(ilist);
|
||||
}
|
||||
@ -888,8 +891,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
operator=(
|
||||
string_view_type sv)
|
||||
operator=(string_view_type sv)
|
||||
{
|
||||
return assign(sv);
|
||||
}
|
||||
@ -915,8 +917,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
assign(
|
||||
basic_static_string const& s) noexcept;
|
||||
assign(basic_static_string const& s) noexcept;
|
||||
|
||||
/** Replace the contents.
|
||||
|
||||
@ -928,8 +929,7 @@ public:
|
||||
template<std::size_t M>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
assign(
|
||||
basic_static_string<M, CharT, Traits> const& s)
|
||||
assign(basic_static_string<M, CharT, Traits> const& s)
|
||||
{
|
||||
// VFALCO this could come in two flavors,
|
||||
// N>M and N<M, and skip the exception
|
||||
@ -974,8 +974,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string&
|
||||
assign(
|
||||
CharT const* s)
|
||||
assign(CharT const* s)
|
||||
{
|
||||
return assign(s, Traits::length(s));
|
||||
}
|
||||
@ -1028,7 +1027,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
assign(T const& t)
|
||||
@ -1056,7 +1055,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
assign(
|
||||
@ -1357,9 +1356,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
void
|
||||
shrink_to_fit() noexcept
|
||||
{
|
||||
}
|
||||
shrink_to_fit() noexcept { }
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
@ -1555,8 +1552,7 @@ public:
|
||||
size_type count = npos)
|
||||
{
|
||||
BOOST_STATIC_STRING_THROW_IF(
|
||||
index_str > str.size(), std::out_of_range{"index_str > str.size()"}
|
||||
);
|
||||
index_str > str.size(), std::out_of_range{"index_str > str.size()"});
|
||||
return insert_unchecked(index, str.data() + index_str, (std::min)(count, str.size() - index_str));
|
||||
}
|
||||
|
||||
@ -1570,8 +1566,7 @@ public:
|
||||
size_type count = npos)
|
||||
{
|
||||
BOOST_STATIC_STRING_THROW_IF(
|
||||
index_str > str.size(), std::out_of_range{"index_str > str.size()"}
|
||||
);
|
||||
index_str > str.size(), std::out_of_range{"index_str > str.size()"});
|
||||
return insert(index, str.data() + index_str, (std::min)(count, str.size() - index_str));
|
||||
}
|
||||
#endif
|
||||
@ -1684,7 +1679,7 @@ public:
|
||||
typename std::enable_if<
|
||||
detail::is_input_iterator<
|
||||
InputIterator>::value &&
|
||||
! detail::is_forward_iterator<
|
||||
!detail::is_forward_iterator<
|
||||
InputIterator>::value, iterator>::type
|
||||
#endif
|
||||
insert(
|
||||
@ -1779,7 +1774,7 @@ public:
|
||||
typename std::enable_if<
|
||||
std::is_convertible<
|
||||
T const&, string_view_type>::value &&
|
||||
! std::is_convertible<
|
||||
!std::is_convertible<
|
||||
T const&, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
@ -1829,7 +1824,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T const&, string_view_type>::value &&
|
||||
! std::is_convertible<T const&, CharT const*>::value,
|
||||
!std::is_convertible<T const&, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
insert(
|
||||
@ -1878,8 +1873,7 @@ public:
|
||||
*/
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
void
|
||||
push_back(
|
||||
CharT ch);
|
||||
push_back(CharT ch);
|
||||
|
||||
/** Removes the last character from the string
|
||||
|
||||
@ -2046,7 +2040,7 @@ public:
|
||||
typename std::enable_if<
|
||||
std::is_convertible<
|
||||
T const&, string_view_type>::value &&
|
||||
! std::is_convertible<
|
||||
!std::is_convertible<
|
||||
T const&, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
@ -2077,7 +2071,7 @@ public:
|
||||
typename std::enable_if<
|
||||
std::is_convertible<
|
||||
T const&, string_view_type>::value &&
|
||||
! std::is_convertible<
|
||||
!std::is_convertible<
|
||||
T const&, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
@ -2170,7 +2164,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
operator+=(
|
||||
@ -2317,7 +2311,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T const&, string_view_type>::value &&
|
||||
! std::is_convertible<T const&, CharT const*>::value,
|
||||
!std::is_convertible<T const&, CharT const*>::value,
|
||||
int>::type
|
||||
#endif
|
||||
compare(
|
||||
@ -2438,15 +2432,13 @@ public:
|
||||
/// Exchange the contents of this string with another.
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
void
|
||||
swap(
|
||||
basic_static_string& s) noexcept;
|
||||
swap(basic_static_string& s) noexcept;
|
||||
|
||||
/// Exchange the contents of this string with another.
|
||||
template<std::size_t M>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
void
|
||||
swap(
|
||||
basic_static_string<M, CharT, Traits>& s);
|
||||
swap(basic_static_string<M, CharT, Traits>& s);
|
||||
|
||||
/** Replace a substring with a string.
|
||||
|
||||
@ -2540,8 +2532,7 @@ public:
|
||||
size_type n2 = npos)
|
||||
{
|
||||
BOOST_STATIC_STRING_THROW_IF(
|
||||
pos2 > str.size(), std::out_of_range{"pos2 > str.size()"}
|
||||
);
|
||||
pos2 > str.size(), std::out_of_range{"pos2 > str.size()"});
|
||||
return replace_unchecked(pos1, n1, str.data() + pos2, (std::min)(n2, str.size() - pos2));
|
||||
}
|
||||
|
||||
@ -2556,8 +2547,7 @@ public:
|
||||
size_type n2 = npos)
|
||||
{
|
||||
BOOST_STATIC_STRING_THROW_IF(
|
||||
pos2 > str.size(), std::out_of_range{"pos2 > str.size()"}
|
||||
);
|
||||
pos2 > str.size(), std::out_of_range{"pos2 > str.size()"});
|
||||
return replace(pos1, n1, str.data() + pos2, (std::min)(n2, str.size() - pos2));
|
||||
}
|
||||
#endif
|
||||
@ -2599,7 +2589,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
replace(
|
||||
@ -2652,7 +2642,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
replace(
|
||||
@ -2842,7 +2832,7 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
basic_static_string&>::type
|
||||
#endif
|
||||
replace(
|
||||
@ -3011,7 +3001,7 @@ public:
|
||||
typename std::enable_if<
|
||||
detail::is_input_iterator<
|
||||
InputIterator>::value &&
|
||||
! detail::is_forward_iterator<
|
||||
!detail::is_forward_iterator<
|
||||
InputIterator>::value,
|
||||
basic_static_string<N, CharT, Traits>&>::type
|
||||
#endif
|
||||
@ -3111,13 +3101,13 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
size_type>::type
|
||||
#endif
|
||||
find(
|
||||
const T& t,
|
||||
size_type pos = 0) const noexcept(detail::is_nothrow_convertible<const T&,
|
||||
string_view_type>::value)
|
||||
size_type pos = 0) const
|
||||
noexcept(detail::is_nothrow_convertible<const T&, string_view_type>::value)
|
||||
{
|
||||
string_view_type sv = t;
|
||||
return find(sv.data(), pos, sv.size());
|
||||
@ -3267,13 +3257,13 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
size_type>::type
|
||||
#endif
|
||||
rfind(
|
||||
const T& t,
|
||||
size_type pos = npos) const noexcept(detail::is_nothrow_convertible<const T&,
|
||||
string_view_type>::value)
|
||||
size_type pos = npos) const
|
||||
noexcept(detail::is_nothrow_convertible<const T&, string_view_type>::value)
|
||||
{
|
||||
string_view_type sv = t;
|
||||
return rfind(sv.data(), pos, sv.size());
|
||||
@ -3418,13 +3408,13 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
size_type>::type
|
||||
#endif
|
||||
find_first_of(
|
||||
const T& t,
|
||||
size_type pos = 0) const noexcept(detail::is_nothrow_convertible<const T&,
|
||||
string_view_type>::value)
|
||||
size_type pos = 0) const
|
||||
noexcept(detail::is_nothrow_convertible<const T&, string_view_type>::value)
|
||||
{
|
||||
string_view_type sv = t;
|
||||
return find_first_of(sv.data(), pos, sv.size());
|
||||
@ -3564,13 +3554,13 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
size_type>::type
|
||||
#endif
|
||||
find_last_of(
|
||||
const T& t,
|
||||
size_type pos = npos) const noexcept(detail::is_nothrow_convertible<const T&,
|
||||
string_view_type>::value)
|
||||
size_type pos = npos) const
|
||||
noexcept(detail::is_nothrow_convertible<const T&, string_view_type>::value)
|
||||
{
|
||||
string_view_type sv = t;
|
||||
return find_last_of(sv.data(), pos, sv.size());
|
||||
@ -3709,13 +3699,13 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
size_type>::type
|
||||
#endif
|
||||
find_first_not_of(
|
||||
const T& t,
|
||||
size_type pos = 0) const noexcept(detail::is_nothrow_convertible<const T&,
|
||||
string_view_type>::value)
|
||||
size_type pos = 0) const
|
||||
noexcept(detail::is_nothrow_convertible<const T&, string_view_type>::value)
|
||||
{
|
||||
string_view_type sv = t;
|
||||
return find_first_not_of(sv.data(), pos, sv.size());
|
||||
@ -3853,13 +3843,13 @@ public:
|
||||
#else
|
||||
typename std::enable_if<
|
||||
std::is_convertible<T, string_view_type>::value &&
|
||||
! std::is_convertible<T, CharT const*>::value,
|
||||
!std::is_convertible<T, CharT const*>::value,
|
||||
size_type>::type
|
||||
#endif
|
||||
find_last_not_of(
|
||||
const T& t,
|
||||
size_type pos = npos) const noexcept(detail::is_nothrow_convertible<const T&,
|
||||
string_view_type>::value)
|
||||
size_type pos = npos) const
|
||||
noexcept(detail::is_nothrow_convertible<const T&, string_view_type>::value)
|
||||
{
|
||||
string_view_type sv = t;
|
||||
return find_last_not_of(sv.data(), pos, sv.size());
|
||||
@ -4364,10 +4354,7 @@ operator+(
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<
|
||||
std::size_t N,
|
||||
typename CharT,
|
||||
typename Traits>
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
inline
|
||||
void
|
||||
@ -4400,7 +4387,8 @@ swap(
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
inline
|
||||
std::basic_ostream<CharT, Traits>&
|
||||
operator<<(std::basic_ostream<CharT, Traits>& os,
|
||||
operator<<(
|
||||
std::basic_ostream<CharT, Traits>& os,
|
||||
basic_static_string<N, CharT, Traits> const& s)
|
||||
{
|
||||
return os << basic_string_view<CharT, Traits>(s.data(), s.size());
|
||||
@ -4611,7 +4599,6 @@ hash_value(
|
||||
/// std::hash partial specialization for basic_static_string
|
||||
namespace std
|
||||
{
|
||||
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
struct hash<
|
||||
#if GENERATING_DOCUMENTATION
|
||||
@ -4667,7 +4654,8 @@ template<std::size_t N, typename CharT, typename Traits>
|
||||
template<std::size_t M>
|
||||
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
||||
basic_static_string<N, CharT, Traits>::
|
||||
basic_static_string(basic_static_string<M, CharT, Traits> const& other,
|
||||
basic_static_string(
|
||||
basic_static_string<M, CharT, Traits> const& other,
|
||||
size_type pos)
|
||||
{
|
||||
assign(other, pos);
|
||||
@ -4996,7 +4984,7 @@ insert(
|
||||
typename std::enable_if<
|
||||
detail::is_input_iterator<
|
||||
InputIterator>::value &&
|
||||
! detail::is_forward_iterator<
|
||||
!detail::is_forward_iterator<
|
||||
InputIterator>::value, iterator>::type
|
||||
{
|
||||
const auto curr_size = size();
|
||||
@ -5211,7 +5199,8 @@ replace(
|
||||
size_type pos,
|
||||
size_type n1,
|
||||
size_type n2,
|
||||
CharT c) -> basic_static_string<N, CharT, Traits> &
|
||||
CharT c) ->
|
||||
basic_static_string<N, CharT, Traits>&
|
||||
{
|
||||
const auto curr_size = size();
|
||||
const auto curr_data = data();
|
||||
@ -5304,7 +5293,7 @@ replace(
|
||||
typename std::enable_if<
|
||||
detail::is_input_iterator<
|
||||
InputIterator>::value &&
|
||||
! detail::is_forward_iterator<
|
||||
!detail::is_forward_iterator<
|
||||
InputIterator>::value,
|
||||
basic_static_string<N, CharT, Traits>&>::type
|
||||
{
|
||||
@ -5478,7 +5467,7 @@ basic_static_string<N, CharT, Traits>::
|
||||
read_back(
|
||||
InputIterator first,
|
||||
InputIterator last) ->
|
||||
std::size_t
|
||||
size_type
|
||||
{
|
||||
const auto curr_data = data();
|
||||
auto new_size = size();
|
||||
|
Reference in New Issue
Block a user