|
|
|
@ -34,7 +34,6 @@
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cwchar>
|
|
|
|
|
#include <functional>
|
|
|
|
|
#include <initializer_list>
|
|
|
|
|
#include <limits>
|
|
|
|
@ -58,9 +57,11 @@ template<std::size_t N>
|
|
|
|
|
using static_string =
|
|
|
|
|
basic_static_string<N, char, std::char_traits<char>>;
|
|
|
|
|
|
|
|
|
|
#ifdef BOOST_STATIC_STRING_HAS_WCHAR
|
|
|
|
|
template<std::size_t N>
|
|
|
|
|
using static_wstring =
|
|
|
|
|
basic_static_string<N, wchar_t, std::char_traits<wchar_t>>;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
template<std::size_t N>
|
|
|
|
|
using static_u16string =
|
|
|
|
@ -145,31 +146,36 @@ struct is_string_like<
|
|
|
|
|
// directly and other convertible types such as std::string.
|
|
|
|
|
// When no string_view type is available, then we check for the
|
|
|
|
|
// data and size member functions, and use them directly for assignments.
|
|
|
|
|
template<typename T, typename CharT, typename Traits, typename = void>
|
|
|
|
|
// Types convertible to basic_static_string are not considered viewable
|
|
|
|
|
// to prevent any ambiguity during overload resolution.
|
|
|
|
|
template<std::size_t N, typename T, typename CharT, typename Traits, typename = void>
|
|
|
|
|
struct enable_if_viewable { };
|
|
|
|
|
|
|
|
|
|
template<typename T, typename CharT, typename Traits>
|
|
|
|
|
struct enable_if_viewable<T, CharT, Traits,
|
|
|
|
|
template<std::size_t N, typename T, typename CharT, typename Traits>
|
|
|
|
|
struct enable_if_viewable<N, T, CharT, Traits,
|
|
|
|
|
typename std::enable_if<
|
|
|
|
|
#if !defined(BOOST_STATIC_STRING_HAS_ANY_STRING_VIEW)
|
|
|
|
|
is_string_like<T, CharT>::value
|
|
|
|
|
is_string_like<T, CharT>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string<N, CharT, Traits>&>::value
|
|
|
|
|
#elif defined(BOOST_STATIC_STRING_STANDALONE)
|
|
|
|
|
std::is_convertible<const T&, std::basic_string_view<CharT, Traits>>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string<N, CharT, Traits>&>::value
|
|
|
|
|
#else
|
|
|
|
|
(
|
|
|
|
|
std::is_convertible<const T&, basic_string_view<CharT, Traits>>::value ||
|
|
|
|
|
std::is_convertible<const T&, core::basic_string_view<CharT>>::value
|
|
|
|
|
) &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string<N, CharT, Traits>&>::value
|
|
|
|
|
#endif
|
|
|
|
|
>::type>
|
|
|
|
|
{
|
|
|
|
|
using type = void;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
template<typename T, typename CharT, typename Traits>
|
|
|
|
|
using enable_if_viewable_t = typename enable_if_viewable<T, CharT, Traits>::type;
|
|
|
|
|
template<std::size_t N, typename T, typename CharT, typename Traits>
|
|
|
|
|
using enable_if_viewable_t = typename enable_if_viewable<N, T, CharT, Traits>::type;
|
|
|
|
|
|
|
|
|
|
// The common string_view type used in private operations with enable_if_viewable_t
|
|
|
|
|
// - T const& itself when no string_view type is available
|
|
|
|
@ -550,6 +556,7 @@ to_static_string_int_impl(Integer value) noexcept
|
|
|
|
|
return static_string<N>(digits_begin, std::distance(digits_begin, digits_end));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef BOOST_STATIC_STRING_HAS_WCHAR
|
|
|
|
|
template<std::size_t N, typename Integer>
|
|
|
|
|
inline
|
|
|
|
|
static_wstring<N>
|
|
|
|
@ -561,6 +568,7 @@ to_static_wstring_int_impl(Integer value) noexcept
|
|
|
|
|
digits_end, value, std::is_signed<Integer>{});
|
|
|
|
|
return static_wstring<N>(digits_begin, std::distance(digits_begin, digits_end));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
BOOST_STATIC_STRING_CPP11_CONSTEXPR
|
|
|
|
|
inline
|
|
|
|
@ -638,6 +646,7 @@ to_static_string_float_impl(long double value) noexcept
|
|
|
|
|
return static_string<N>(buffer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef BOOST_STATIC_STRING_HAS_WCHAR
|
|
|
|
|
template<std::size_t N>
|
|
|
|
|
inline
|
|
|
|
|
static_wstring<N>
|
|
|
|
@ -711,6 +720,7 @@ to_static_wstring_float_impl(long double value) noexcept
|
|
|
|
|
// this will not throw
|
|
|
|
|
return static_wstring<N>(buffer);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if defined(__GNUC__) && __GNUC__ >= 7
|
|
|
|
|
#pragma GCC diagnostic pop
|
|
|
|
@ -1117,7 +1127,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
explicit
|
|
|
|
@ -1137,7 +1147,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -1314,7 +1324,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
@ -1325,7 +1336,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -1603,7 +1614,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
@ -1614,7 +1626,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -1648,7 +1660,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
@ -1664,7 +1677,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
basic_static_string&
|
|
|
|
@ -2594,7 +2607,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@param index The index to insert at.
|
|
|
|
|
@param t The string to insert from.
|
|
|
|
@ -2604,7 +2618,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -2635,7 +2649,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
|
|
|
|
|
@ -2651,7 +2666,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3006,7 +3021,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<T const&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<T const&, char const*>::value
|
|
|
|
|
!std::is_convertible<T const&, char const*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
@ -3017,7 +3033,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3043,7 +3059,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<T const&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<T const&, char const*>::value
|
|
|
|
|
!std::is_convertible<T const&, char const*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
@ -3059,7 +3076,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3181,7 +3198,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<T const&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<T const&, char const*>::value
|
|
|
|
|
!std::is_convertible<T const&, char const*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
@ -3192,7 +3210,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3440,7 +3458,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value.
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value.
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return The result of lexicographically comparing `s` and the string.
|
|
|
|
@ -3449,7 +3468,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3484,7 +3503,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value.
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value.
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return The result of lexicographically comparing `s` and `sub`.
|
|
|
|
@ -3497,7 +3517,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3535,7 +3555,8 @@ public:
|
|
|
|
|
|
|
|
|
|
@code
|
|
|
|
|
std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value.
|
|
|
|
|
!std::is_convertible<const T&, const_pointer>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value.
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
@return The result of lexicographically comparing `sub1` and `sub2`.
|
|
|
|
@ -3552,7 +3573,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3867,7 +3888,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
|
|
|
|
|
@ -3880,7 +3902,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -3913,7 +3935,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
|
|
|
|
|
@ -3930,7 +3953,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -4129,7 +4152,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return `*this`
|
|
|
|
|
|
|
|
|
@ -4142,7 +4166,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -4392,7 +4416,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return The lowest index `idx` greater than or equal to `pos`
|
|
|
|
|
where each element of `{sv.begin(), sv.end())` is equal to
|
|
|
|
@ -4405,7 +4430,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -4549,7 +4574,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return The highest index `idx` less than or equal to `pos`
|
|
|
|
|
where each element of `{sv.begin(), sv.end())` is equal to
|
|
|
|
@ -4562,7 +4588,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -4702,7 +4728,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return The index corrosponding to the first occurrence of
|
|
|
|
|
any of the characters in `{sv.begin(), sv.end())` within
|
|
|
|
@ -4714,7 +4741,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -4849,7 +4876,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return The index corrosponding to the last occurrence of
|
|
|
|
|
any of the characters in `{sv.begin(), sv.end())` within
|
|
|
|
@ -4861,7 +4889,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -4995,7 +5023,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return The index corrosponding to the first occurrence of
|
|
|
|
|
a character that is not in `{sv.begin(), sv.end())` within
|
|
|
|
@ -5007,7 +5036,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5140,7 +5169,8 @@ public:
|
|
|
|
|
@par Constraints
|
|
|
|
|
|
|
|
|
|
`std::is_convertible<const T&, string_view>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value`.
|
|
|
|
|
!std::is_convertible<const T&, const CharT*>::value &&
|
|
|
|
|
!std::is_convertible<const T&, const basic_static_string&>::value`.
|
|
|
|
|
|
|
|
|
|
@return The index corrosponding to the last occurrence of
|
|
|
|
|
a character that is not in `{sv.begin(), sv.end())` within
|
|
|
|
@ -5152,7 +5182,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5284,7 +5314,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5348,7 +5378,7 @@ public:
|
|
|
|
|
*/
|
|
|
|
|
template<typename T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5617,7 +5647,7 @@ operator==(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5635,7 +5665,7 @@ operator==(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5679,7 +5709,7 @@ operator!=(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5697,7 +5727,7 @@ operator!=(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5741,7 +5771,7 @@ operator<(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5759,7 +5789,7 @@ operator<(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5803,7 +5833,7 @@ operator<=(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5821,7 +5851,7 @@ operator<=(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5865,7 +5895,7 @@ operator>(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5883,7 +5913,7 @@ operator>(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5928,7 +5958,7 @@ operator>=(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -5946,7 +5976,7 @@ operator>=(
|
|
|
|
|
|
|
|
|
|
template<std::size_t N, typename CharT, typename Traits, class T
|
|
|
|
|
#ifndef BOOST_STATIC_STRING_DOCS
|
|
|
|
|
, typename = detail::enable_if_viewable_t<T, CharT, Traits>
|
|
|
|
|
, typename = detail::enable_if_viewable_t<N, T, CharT, Traits>
|
|
|
|
|
#endif
|
|
|
|
|
>
|
|
|
|
|
BOOST_STATIC_STRING_CPP14_CONSTEXPR
|
|
|
|
@ -6202,6 +6232,7 @@ to_static_string(long double value) noexcept
|
|
|
|
|
std::numeric_limits<long double>::max_digits10 + 4>(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef BOOST_STATIC_STRING_HAS_WCHAR
|
|
|
|
|
/// Converts `value` to a `static_wstring`
|
|
|
|
|
static_wstring<std::numeric_limits<int>::digits10 + 2>
|
|
|
|
|
inline
|
|
|
|
@ -6282,6 +6313,7 @@ to_static_wstring(long double value) noexcept
|
|
|
|
|
return detail::to_static_wstring_float_impl<
|
|
|
|
|
std::numeric_limits<long double>::max_digits10 + 4>(value);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
@ -6322,7 +6354,9 @@ hash_value(
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
using static_strings::static_string;
|
|
|
|
|
#ifdef BOOST_STATIC_STRING_HAS_WCHAR
|
|
|
|
|
using static_strings::static_wstring;
|
|
|
|
|
#endif
|
|
|
|
|
using static_strings::static_u16string;
|
|
|
|
|
using static_strings::static_u32string;
|
|
|
|
|
} // boost
|
|
|
|
@ -6351,39 +6385,30 @@ struct hash<
|
|
|
|
|
return std::hash<view_type>()(view_type(str.data(), str.size()));
|
|
|
|
|
#else
|
|
|
|
|
std::size_t seed = 0;
|
|
|
|
|
for (CharT const& c : str) {
|
|
|
|
|
mix_impl(std::integral_constant<bool, sizeof(std::size_t) >= 8>{}, seed, c);
|
|
|
|
|
for (CharT const& c : str)
|
|
|
|
|
{
|
|
|
|
|
#if BOOST_STATIC_STRING_ARCH == 64
|
|
|
|
|
seed += 0x9e3779b9 + std::hash<CharT>()( c );
|
|
|
|
|
std::size_t const m = (std::size_t(0xe9846af) << 32) + 0x9b1a615d;
|
|
|
|
|
seed ^= seed >> 32;
|
|
|
|
|
seed *= m;
|
|
|
|
|
seed ^= seed >> 32;
|
|
|
|
|
seed *= m;
|
|
|
|
|
seed ^= seed >> 28;
|
|
|
|
|
#elif BOOST_STATIC_STRING_ARCH == 32
|
|
|
|
|
seed += 0x9e3779b9 + std::hash<CharT>()( c );
|
|
|
|
|
std::size_t const m1 = 0x21f0aaad;
|
|
|
|
|
std::size_t const m2 = 0x735a2d97;
|
|
|
|
|
seed ^= seed >> 16;
|
|
|
|
|
seed *= m1;
|
|
|
|
|
seed ^= seed >> 15;
|
|
|
|
|
seed *= m2;
|
|
|
|
|
seed ^= seed >> 15;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
return seed;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
void
|
|
|
|
|
mix_impl(std::true_type, std::size_t& seed, CharT c)
|
|
|
|
|
{
|
|
|
|
|
seed += 0x9e3779b9 + std::hash<CharT>()( c );
|
|
|
|
|
std::size_t const m = (std::size_t(0xe9846af) << 32) + 0x9b1a615d;
|
|
|
|
|
seed ^= seed >> 32;
|
|
|
|
|
seed *= m;
|
|
|
|
|
seed ^= seed >> 32;
|
|
|
|
|
seed *= m;
|
|
|
|
|
seed ^= seed >> 28;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
void
|
|
|
|
|
mix_impl(std::false_type, std::size_t& seed, CharT c)
|
|
|
|
|
{
|
|
|
|
|
seed += 0x9e3779b9 + std::hash<CharT>()( c );
|
|
|
|
|
std::size_t const m1 = 0x21f0aaad;
|
|
|
|
|
std::size_t const m2 = 0x735a2d97;
|
|
|
|
|
seed ^= seed >> 16;
|
|
|
|
|
seed *= m1;
|
|
|
|
|
seed ^= seed >> 15;
|
|
|
|
|
seed *= m2;
|
|
|
|
|
seed ^= seed >> 15;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
} // std
|
|
|
|
|
|
|
|
|
|