util/StringSplit: reimplement without std::distance()

Avoid including <iterator>.
This commit is contained in:
Max Kellermann 2022-07-06 06:24:00 +02:00 committed by Max Kellermann
parent 2e5d46c399
commit 3ab3d5555e

View File

@ -47,7 +47,7 @@ constexpr std::pair<std::basic_string_view<T>, std::basic_string_view<T>>
Partition(const std::basic_string_view<T> haystack,
const typename std::basic_string_view<T>::const_pointer position) noexcept
{
return Partition(haystack, std::distance(haystack.data(), position));
return Partition(haystack, position - haystack.data());
}
template<typename T>