gcc13 fix

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-28 12:12:54 -03:00
committed by Konstantin Pastbin
parent 52a0c45083
commit b1c2b204a1

View File

@@ -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);