From 1bd2260fa5ff6ee3495329abe5ecff6106efcf3d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 17 Nov 2014 13:51:21 +0000 Subject: Import std::begin/std::end so that container utils work correctly with non std containers --- src/utils.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/utils.hh') diff --git a/src/utils.hh b/src/utils.hh index 9bb7c007..a71c7700 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) { -- cgit v1.2.3