Test use of std::string::ends_with
This commit is contained in:
parent
8a67ee5101
commit
e0507c1156
1 changed files with 4 additions and 0 deletions
|
@ -293,7 +293,11 @@ bool file_tree_checksum::operator==(const file_tree_checksum &rhs) const
|
|||
|
||||
bool ends_with(const std::string& str, const std::string& suffix)
|
||||
{
|
||||
#ifdef __cpp_lib_starts_ends_with
|
||||
return str.ends_with(suffix);
|
||||
#else
|
||||
return str.size() >= suffix.size() && std::equal(suffix.begin(),suffix.end(),str.end()-suffix.size());
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string read_map(const std::string& name)
|
||||
|
|
Loading…
Add table
Reference in a new issue