forked from boostorg/static_string
Back to requiring a string_view implementation
This commit is contained in:
@ -13,18 +13,16 @@
|
||||
// Are we dependent on Boost?
|
||||
#define BOOST_FIXED_STRING_USE_BOOST
|
||||
|
||||
// C++ version
|
||||
#if __cplusplus >= 201703L
|
||||
#define BOOST_FIXED_STRING_CPP17
|
||||
#elif __cplusplus >= 201402L
|
||||
#define BOOST_FIXED_STRING_CPP14
|
||||
#else
|
||||
#define BOOST_FIXED_STRING_CPP11
|
||||
// Can we have deduction guides?
|
||||
#ifdef __cpp_deduction_guides
|
||||
#define BOOST_FIXED_STRING_USE_DEDUCT
|
||||
#endif
|
||||
|
||||
// See if we can use `string_view`
|
||||
#if defined(BOOST_FIXED_STRING_CPP17) || defined(BOOST_FIXED_STRING_USE_BOOST)
|
||||
#define BOOST_FIXED_STRING_STRING_VIEW
|
||||
// Can we use [[nodiscard]]?
|
||||
#if __has_attribute(nodiscard)
|
||||
#define BOOST_FIXED_STRING_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define BOOST_FIXED_STRING_NODISCARD
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_USE_BOOST
|
||||
@ -34,47 +32,32 @@
|
||||
#include <boost/throw_exception.hpp>
|
||||
#else
|
||||
#include <cassert>
|
||||
#ifdef BOOST_FIXED_STRING_CPP17
|
||||
#include <string_view>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Boost and non-Boost versions of utilities
|
||||
#ifdef BOOST_FIXED_STRING_USE_BOOST
|
||||
#define BOOST_FIXED_STRING_THROW(ex) BOOST_THROW_EXCEPTION(ex)
|
||||
#define BOOST_FIXED_STRING_STATIC_ASSERT(cond, msg) BOOST_STATIC_ASSERT_MSG(cond, msg)
|
||||
#define BOOST_FIXED_STRING_ASSERT(cond) BOOST_ASSERT(cond)
|
||||
#ifdef BOOST_NODISCARD
|
||||
#define BOOST_FIXED_STRING_NODISCARD BOOST_NODISCARD
|
||||
#else
|
||||
#define BOOST_FIXED_STRING_NODISCARD
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_FIXED_STRING_THROW(ex) throw ex
|
||||
#define BOOST_FIXED_STRING_STATIC_ASSERT(cond, msg) static_assert(cond, msg)
|
||||
#define BOOST_FIXED_STRING_ASSERT(cond) assert(cond)
|
||||
#ifdef BOOST_FIXED_STRING_CPP17
|
||||
#define BOOST_FIXED_STRING_NODISCARD [[nodiscard]]
|
||||
#else
|
||||
#define BOOST_FIXED_STRING_NODISCARD
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
namespace fixed_string {
|
||||
|
||||
/// The type of `string_view` used by the library
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
using string_view =
|
||||
#ifdef BOOST_FIXED_STRING_USE_BOOST
|
||||
boost::string_view;
|
||||
#else
|
||||
std::string_view;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// The type of `basic_string_view` used by the library
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename CharT, typename Traits>
|
||||
using basic_string_view =
|
||||
#ifdef BOOST_FIXED_STRING_USE_BOOST
|
||||
@ -82,7 +65,6 @@ using basic_string_view =
|
||||
#else
|
||||
std::basic_string_view<CharT, Traits>;
|
||||
#endif
|
||||
#endif
|
||||
} // fixed_string
|
||||
} // boost
|
||||
|
||||
|
@ -44,8 +44,6 @@ lexicographical_compare(
|
||||
return Traits::compare(s1, s2, n1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename CharT, typename Traits>
|
||||
inline
|
||||
int
|
||||
@ -56,7 +54,6 @@ lexicographical_compare(
|
||||
return detail::lexicographical_compare<
|
||||
CharT, Traits>(s1.data(), s1.size(), s2, n2);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N, typename CharT, typename Traits >
|
||||
inline
|
||||
@ -69,7 +66,6 @@ lexicographical_compare(
|
||||
CharT, Traits>(s1.data(), s1.size(), s2, n2);
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename CharT, typename Traits>
|
||||
inline
|
||||
int
|
||||
@ -80,7 +76,6 @@ lexicographical_compare(
|
||||
return detail::lexicographical_compare<CharT, Traits>(
|
||||
s1.data(), s1.size(), s2.data(), s2.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N, std::size_t M, typename CharT, typename Traits>
|
||||
inline
|
||||
|
@ -77,10 +77,8 @@ public:
|
||||
std::reverse_iterator<const_iterator>;
|
||||
|
||||
/// The type of `string_view` returned by the interface
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
using string_view_type =
|
||||
string_view;
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
@ -160,11 +158,9 @@ public:
|
||||
|
||||
/// Construct from a `string_view`
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
explicit
|
||||
fixed_string(
|
||||
string_view_type sv);
|
||||
#endif
|
||||
|
||||
/** Construct from any object convertible to `string_view_type`.
|
||||
|
||||
@ -172,7 +168,6 @@ public:
|
||||
obtained by converting `t` to `string_view_type`,
|
||||
and used to construct the string.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T
|
||||
#ifndef GENERATING_DOCUMENTATION
|
||||
, class = typename std::enable_if<
|
||||
@ -183,7 +178,6 @@ public:
|
||||
T const& t,
|
||||
size_type pos,
|
||||
size_type n);
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
@ -244,14 +238,12 @@ public:
|
||||
}
|
||||
|
||||
/// Assign from `string_view_type`.
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
fixed_string&
|
||||
operator=(
|
||||
string_view_type sv)
|
||||
{
|
||||
return assign(sv);
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Replace the contents with `count` copies of character `ch`
|
||||
|
||||
@ -354,7 +346,6 @@ public:
|
||||
|
||||
@throw std::length_error if `string_view_type{t}.size() > max_size()`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -369,7 +360,6 @@ public:
|
||||
string_view_type ss{t};
|
||||
return assign(ss.data(), ss.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Replace the contents with a copy of the characters from `string_view_type{t}.substr(pos, count)`
|
||||
|
||||
@ -381,7 +371,6 @@ public:
|
||||
@throw std::length_error if `string_view_type{t}.substr(pos, count).size() > max_size()`
|
||||
*/
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -398,7 +387,6 @@ public:
|
||||
{
|
||||
return assign(string_view_type{t}.substr(pos, count));
|
||||
}
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
@ -502,13 +490,11 @@ public:
|
||||
}
|
||||
|
||||
/// Convert a static string to a `string_view_type`
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
operator string_view_type() const noexcept
|
||||
{
|
||||
return basic_string_view<
|
||||
CharT, Traits>{data(), size()};
|
||||
}
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
//
|
||||
@ -724,7 +710,6 @@ public:
|
||||
@throw std::length_error if `size() + sv.size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
fixed_string&
|
||||
insert(
|
||||
size_type index,
|
||||
@ -732,7 +717,6 @@ public:
|
||||
{
|
||||
return insert(index, sv.data(), sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Inserts the string `sv.substr(index_str, count)` at the position `index`
|
||||
|
||||
@ -742,7 +726,6 @@ public:
|
||||
@throw std::length_error if `size() + sv.substr(index_str, count).size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
fixed_string&
|
||||
insert(
|
||||
size_type index,
|
||||
@ -752,7 +735,6 @@ public:
|
||||
{
|
||||
return insert(index, sv.substr(index_str, count));
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Inserts character `ch` before the character (if any) pointed by `pos`
|
||||
|
||||
@ -829,7 +811,6 @@ public:
|
||||
@throw std::length_error if `size() + string_view{t}.substr(index_str, count).size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -844,7 +825,6 @@ public:
|
||||
insert(
|
||||
size_type index,
|
||||
T const& t);
|
||||
#endif
|
||||
|
||||
/** Inserts elements from `string_view{t}.substr(index_str, count)` at the position `index`
|
||||
|
||||
@ -857,7 +837,6 @@ public:
|
||||
@throw std::length_error if `size() + string_view{t}.substr(index_str, count).size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -872,7 +851,6 @@ public:
|
||||
T const& t,
|
||||
size_type index_str,
|
||||
size_type count = npos);
|
||||
#endif
|
||||
|
||||
/** Removes `min(count, size() - index)` characters starting at `index`
|
||||
|
||||
@ -942,14 +920,12 @@ public:
|
||||
@throw std::length_error if `size() + sv.size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
fixed_string&
|
||||
append(
|
||||
string_view_type sv)
|
||||
{
|
||||
return append(sv.data(), sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Appends the contents of `sv.substr(pos, count)`
|
||||
|
||||
@ -959,7 +935,6 @@ public:
|
||||
@throw std::length_error if `size() + sv.substr(pos, count).size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
fixed_string&
|
||||
append(
|
||||
string_view_type sv,
|
||||
@ -968,7 +943,6 @@ public:
|
||||
{
|
||||
return append(sv.substr(pos, count));
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Appends characters in the range `(s, s + count)`
|
||||
|
||||
@ -1047,7 +1021,6 @@ public:
|
||||
@throw std::length_error if `size() + string_view{t} > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -1064,7 +1037,6 @@ public:
|
||||
{
|
||||
return append(string_view{t});
|
||||
}
|
||||
#endif
|
||||
|
||||
/** Appends characters from `string_view{t}.substr{pos, count}`
|
||||
|
||||
@ -1077,7 +1049,6 @@ public:
|
||||
@throw std::length_error if `size() + string_view{t}.substr(pos, count).size() > max_size()`
|
||||
@return `*this`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -1096,7 +1067,6 @@ public:
|
||||
{
|
||||
return append(string_view{t}.substr(pos, count));
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t M>
|
||||
fixed_string&
|
||||
@ -1156,7 +1126,6 @@ public:
|
||||
|
||||
@throw std::length_error if `string_view_type{t}.size() > max_size()`
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -1171,7 +1140,6 @@ public:
|
||||
{
|
||||
return append(t);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t M>
|
||||
int
|
||||
@ -1235,7 +1203,6 @@ public:
|
||||
substr(pos1, count1), s, count2);
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
int
|
||||
compare(
|
||||
string_view_type s) const
|
||||
@ -1244,9 +1211,6 @@ public:
|
||||
&s_[0], n_, s.data(), s.size());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
int
|
||||
compare(
|
||||
size_type pos1,
|
||||
@ -1256,9 +1220,7 @@ public:
|
||||
return detail::lexicographical_compare<CharT, Traits>(
|
||||
substr(pos1, count1), s);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
int
|
||||
@ -1278,9 +1240,8 @@ public:
|
||||
return compare(pos1, count1,
|
||||
string_view_type(t).substr(pos2, count2));
|
||||
}
|
||||
#endif
|
||||
|
||||
fixed_string
|
||||
string_view_type
|
||||
substr(
|
||||
size_type pos = 0,
|
||||
size_type count = npos) const;
|
||||
@ -1344,7 +1305,6 @@ public:
|
||||
return replace(pos1, n1, str.substr(pos2, n2));
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -1362,12 +1322,9 @@ public:
|
||||
string_view_type sv = t;
|
||||
return replace(pos1, n1, sv.data(), sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATI
|
||||
NG_DOCUMENTATION
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
#else
|
||||
typename std::enable_if<
|
||||
@ -1385,7 +1342,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return replace(pos1, n1, sv.substr(pos2, n2));
|
||||
}
|
||||
#endif
|
||||
|
||||
fixed_string&
|
||||
replace(
|
||||
@ -1419,7 +1375,6 @@ public:
|
||||
return replace(i1, i2, str.data(), str.size());
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<typename T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
fixed_string&
|
||||
@ -1437,7 +1392,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return replace(i1 - begin(), i2 - i1, sv.data(), sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
fixed_string&
|
||||
replace(
|
||||
@ -1506,7 +1460,6 @@ public:
|
||||
`T` is convertible to `string_view` and `T` is not
|
||||
convertible to `CharT const*`.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<class T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
size_type
|
||||
@ -1523,7 +1476,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return find(sv.data(), pos, sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N>
|
||||
size_type
|
||||
@ -1571,7 +1523,6 @@ public:
|
||||
`T` is convertible to `string_view` and `T` is not
|
||||
convertible to `CharT const*`.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<class T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
size_type
|
||||
@ -1588,7 +1539,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return rfind(sv.data(), pos, sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N>
|
||||
size_type
|
||||
@ -1635,7 +1585,6 @@ public:
|
||||
`T` is convertible to `string_view` and `T` is not
|
||||
convertible to `CharT const*`.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<class T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
size_type
|
||||
@ -1652,7 +1601,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return find_first_of(sv.data(), pos, sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N>
|
||||
size_type
|
||||
@ -1699,7 +1647,6 @@ public:
|
||||
`T` is convertible to `string_view` and `T` is not
|
||||
convertible to `CharT const*`.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<class T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
size_type
|
||||
@ -1716,7 +1663,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return find_last_of(sv.data(), pos, sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N>
|
||||
size_type
|
||||
@ -1763,7 +1709,6 @@ public:
|
||||
`T` is convertible to `string_view` and `T` is not
|
||||
convertible to `CharT const*`.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<class T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
size_type
|
||||
@ -1780,7 +1725,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return find_first_not_of(sv.data(), pos, sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<std::size_t N>
|
||||
size_type
|
||||
@ -1827,7 +1771,6 @@ public:
|
||||
`T` is convertible to `string_view` and `T` is not
|
||||
convertible to `CharT const*`.
|
||||
*/
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<class T>
|
||||
#if GENERATING_DOCUMENTATION
|
||||
size_type
|
||||
@ -1844,7 +1787,6 @@ public:
|
||||
string_view_type sv = t;
|
||||
return find_last_not_of(sv.data(), pos, sv.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
template<size_t N>
|
||||
size_type
|
||||
@ -1886,14 +1828,12 @@ public:
|
||||
return find_last_not_of(&c, pos, 1);
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
bool
|
||||
starts_with(
|
||||
string_view_type s) const noexcept
|
||||
{
|
||||
return starts_with(s.data());
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
starts_with(
|
||||
@ -1910,14 +1850,12 @@ public:
|
||||
return n_ >= len && !Traits::compare(s_, s, len);
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
bool
|
||||
ends_with(
|
||||
string_view_type s) const noexcept
|
||||
{
|
||||
return ends_with(s.data());
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
ends_with(
|
||||
@ -2253,10 +2191,7 @@ std::basic_ostream<CharT, Traits>&
|
||||
operator<<(std::basic_ostream<CharT, Traits>& os,
|
||||
fixed_string<N, CharT, Traits> const& s)
|
||||
{
|
||||
// for the non-trivial CharT
|
||||
for (const CharT& c : s)
|
||||
os << c;
|
||||
return os;
|
||||
return os << string_view(s);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -2291,7 +2226,7 @@ to_fixed_string(Integer x);
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_CPP17
|
||||
#ifdef BOOST_FIXED_STRING_USE_DEDUCT
|
||||
template<std::size_t N, typename CharT>
|
||||
fixed_string(CharT(&)[N]) ->
|
||||
fixed_string<N, CharT, std::char_traits<CharT>>;
|
||||
|
@ -113,16 +113,13 @@ fixed_string(std::initializer_list<CharT> init)
|
||||
assign(init.begin(), init.end());
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
fixed_string<N, CharT, Traits>::
|
||||
fixed_string(string_view_type sv)
|
||||
{
|
||||
assign(sv);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
template<class T, class>
|
||||
fixed_string<N, CharT, Traits>::
|
||||
@ -130,7 +127,6 @@ fixed_string(T const& t, size_type pos, size_type n)
|
||||
{
|
||||
assign(t, pos, n);
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
@ -393,7 +389,6 @@ insert(
|
||||
return begin() + index;
|
||||
}
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
template<class T>
|
||||
auto
|
||||
@ -410,9 +405,7 @@ insert(
|
||||
{
|
||||
return insert(index, t, 0, npos);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_FIXED_STRING_STRING_VIEW
|
||||
template<std::size_t N, typename CharT, typename Traits>
|
||||
template<class T>
|
||||
auto
|
||||
@ -433,7 +426,6 @@ insert(
|
||||
string_view_type(t).substr(index_str, count);
|
||||
return insert(index, s.data(), s.size());
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@ -515,7 +507,7 @@ template<std::size_t N, typename CharT, typename Traits>
|
||||
auto
|
||||
fixed_string<N, CharT, Traits>::
|
||||
substr(size_type pos, size_type count) const ->
|
||||
fixed_string<N, CharT, Traits>
|
||||
string_view
|
||||
{
|
||||
if(pos > size())
|
||||
BOOST_FIXED_STRING_THROW(std::out_of_range{
|
||||
|
Reference in New Issue
Block a user