template second parameter for startsWith
Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
parent
52ab999151
commit
28358cd209
@ -6,8 +6,13 @@
|
||||
|
||||
namespace Exiv2::Internal {
|
||||
|
||||
constexpr bool startsWith(std::string_view s, std::string_view start) {
|
||||
template <typename T>
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user