diff --git a/src/utils.hpp b/src/utils.hpp index c385b07d..ffb0fffd 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -6,8 +6,13 @@ namespace Exiv2::Internal { -constexpr bool startsWith(std::string_view s, std::string_view start) { +template +constexpr bool startsWith(std::string_view s, T start) { +#ifdef __cpp_lib_starts_ends_with + return s.starts_with(start); +#else return s.find(start) == 0; +#endif } /// @brief Returns the uppercase version of \b str