Added test case for recursive variadic template specialization

This commit is contained in:
Bartek Kryza
2022-08-07 23:08:37 +02:00
parent 1844b992aa
commit ae7ef11e43
20 changed files with 416 additions and 130 deletions

View File

@@ -263,5 +263,12 @@ template <> bool starts_with(const std::string &s, const std::string &prefix)
return s.rfind(prefix, 0) == 0;
}
template <> bool ends_with(const std::string &value, const std::string &suffix)
{
if (suffix.size() > value.size())
return false;
return std::equal(suffix.rbegin(), suffix.rend(), value.rbegin());
}
}
}