string: add a templated transform comparator

This commit is contained in:
Danny Robson 2021-12-15 09:27:38 +10:00
parent a1460a240f
commit 452328957d

View File

@ -339,11 +339,21 @@ namespace cruft::string {
return false;
}
if (a_cursor == a.end () && b_cursor != b.end ())
return true;
return false;
}
template <typename A, typename B>
requires (!std::is_same_v<A,B>)
bool operator() (A &&a, B &&b) const noexcept
{
return (*this) (
std::string_view (a),
std::string_view (b)
);
}
};