diff --git a/src/string.hh b/src/string.hh index 55276d734..bdb28dd72 100644 --- a/src/string.hh +++ b/src/string.hh @@ -196,16 +196,6 @@ inline StringView String::substr(CharCount pos, CharCount length) const return StringView{*this}.substr(pos, length); } -inline const char* begin(StringView str) -{ - return str.begin(); -} - -inline const char* end(StringView str) -{ - return str.end(); -} - inline String operator+(const char* lhs, const String& rhs) { return String(lhs) + rhs; diff --git a/src/utils.hh b/src/utils.hh index 9bb7c007b..a71c77009 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -90,6 +90,10 @@ ReversedContainer reversed(Container&& container) return ReversedContainer(container); } +// Todo: move that into the following functions once we can remove the decltype +// return type. +using std::begin; +using std::end; template auto find(Container&& container, const T& value) -> decltype(begin(container)) @@ -103,7 +107,6 @@ auto find_if(Container&& container, T op) -> decltype(begin(container)) return std::find_if(begin(container), end(container), op); } - template bool contains(Container&& container, const T& value) {