diff --git a/view.hpp b/view.hpp index 9438cfc7..9e2240e0 100644 --- a/view.hpp +++ b/view.hpp @@ -684,6 +684,24 @@ namespace util { } + /////////////////////////////////////////////////////////////////////////// + template + bool + operator== ( + util::view lhs, + const std::basic_string &rhs + ) { + return lhs.size () == rhs.size () && std::equal (lhs.cbegin (), lhs.cend (), rhs.cbegin ()); + } + + + inline bool + operator== (util::view lhs, const char *rhs) + { + return lhs.size () == strlen (rhs) && std::equal (lhs.cbegin (), lhs.cend (), rhs); + } + + /////////////////////////////////////////////////////////////////////////// template std::ostream&