fix missing string def
parent
e3c925ed11
commit
5375231ce5
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
include(cmake/color.cmake)
|
||||
set(BLT_VERSION 0.20.5)
|
||||
set(BLT_VERSION 0.20.6)
|
||||
set(BLT_TEST_VERSION 0.0.1)
|
||||
|
||||
set(BLT_TARGET BLT)
|
||||
|
|
|
@ -91,7 +91,16 @@ namespace blt::string
|
|||
#endif
|
||||
}
|
||||
|
||||
BLT_CPP20_CONSTEXPR bool ends_with(std::string_view string, std::string_view search);
|
||||
inline BLT_CPP20_CONSTEXPR bool ends_with(std::string_view string, std::string_view search)
|
||||
{
|
||||
#ifdef BLT_USE_CPP20
|
||||
return string.ends_with(search);
|
||||
#else
|
||||
if (string.empty())
|
||||
return false;
|
||||
return string.substr(string.size() - search.size()) == search;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline BLT_CPP20_CONSTEXPR bool ends_with(std::string_view string, char search)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue