mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
committed by
Konstantin Pastbin
parent
52a0c45083
commit
b1c2b204a1
@@ -152,11 +152,17 @@ inline std::string DebugPrint(UniString const & s)
|
|||||||
|
|
||||||
class TokenizeIteratorBase
|
class TokenizeIteratorBase
|
||||||
{
|
{
|
||||||
template <typename...>
|
template <typename T>
|
||||||
static constexpr bool is_utf8cpp_iterator = false;
|
struct is_utf8cpp_iterator
|
||||||
|
{
|
||||||
|
static bool constexpr value = false;
|
||||||
|
};
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename T>
|
||||||
static constexpr bool is_utf8cpp_iterator<utf8::unchecked::iterator<Args...>> = true;
|
struct is_utf8cpp_iterator<utf8::unchecked::iterator<T>>
|
||||||
|
{
|
||||||
|
static bool constexpr value = true;
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
using difference_type = std::ptrdiff_t;
|
using difference_type = std::ptrdiff_t;
|
||||||
@@ -165,7 +171,7 @@ public:
|
|||||||
template <class T>
|
template <class T>
|
||||||
static std::string_view ToStringView(T first, T last)
|
static std::string_view ToStringView(T first, T last)
|
||||||
{
|
{
|
||||||
if constexpr (is_utf8cpp_iterator<T>)
|
if constexpr (is_utf8cpp_iterator<T>::value)
|
||||||
return TokenizeIteratorBase::ToStringView(first.base(), last.base());
|
return TokenizeIteratorBase::ToStringView(first.base(), last.base());
|
||||||
else
|
else
|
||||||
return std::string_view(first, last);
|
return std::string_view(first, last);
|
||||||
|
|||||||
Reference in New Issue
Block a user