summaryrefslogtreecommitdiff
path: root/src/utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-11-17 13:51:21 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-11-17 13:51:21 +0000
commit1bd2260fa5ff6ee3495329abe5ecff6106efcf3d (patch)
treef20e51ab7daaeb65dd84a5a72268a233d9191ba2 /src/utils.hh
parentb43f0fb8530b45298cdd3da2fdebe6c2fa43b5d4 (diff)
Import std::begin/std::end so that container utils work correctly with non std containers
Diffstat (limited to 'src/utils.hh')
-rw-r--r--src/utils.hh5
1 files changed, 4 insertions, 1 deletions
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<Container> reversed(Container&& container)
return ReversedContainer<Container>(container);
}
+// Todo: move that into the following functions once we can remove the decltype
+// return type.
+using std::begin;
+using std::end;
template<typename Container, typename T>
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<typename Container, typename T>
bool contains(Container&& container, const T& value)
{