diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-03-20 19:51:25 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-03-20 19:51:25 +0000 |
| commit | 0cdeb55968c4e313acb81ce7843334f89de1d6a2 (patch) | |
| tree | e6d8614ee716d1778e6e88274bf5100399bd2d57 /src/utils.hh | |
| parent | dc953197c33a33469fff6574335d79c78591d809 (diff) | |
Container utility functions now use the free begin/end functions
Diffstat (limited to 'src/utils.hh')
| -rw-r--r-- | src/utils.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/utils.hh b/src/utils.hh index 6d59749a..c0b090ca 100644 --- a/src/utils.hh +++ b/src/utils.hh @@ -159,22 +159,22 @@ ReversedContainer<Container> reversed(Container&& container) template<typename Container, typename T> -auto find(Container&& container, const T& value) -> decltype(container.begin()) +auto find(Container&& container, const T& value) -> decltype(begin(container)) { - return std::find(container.begin(), container.end(), value); + return std::find(begin(container), end(container), value); } template<typename Container, typename T> -auto find_if(Container&& container, T op) -> decltype(container.begin()) +auto find_if(Container&& container, T op) -> decltype(begin(container)) { - return std::find_if(container.begin(), container.end(), op); + return std::find_if(begin(container), end(container), op); } template<typename Container, typename T> bool contains(Container&& container, const T& value) { - return find(container, value) != container.end(); + return find(container, value) != end(container); } template<typename T1, typename T2> |
