virthttp  0.0
libvirt http interface
cexpr_algs.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 namespace cexpr {
4 template <class InputIt, class T> constexpr InputIt find(InputIt first, InputIt last, const T& value) {
5  for (; first != last; ++first) {
6  if (*first == value) {
7  return first;
8  }
9  }
10  return last;
11 }
12 template <class InputIt, class UnaryPredicate> constexpr InputIt find_if(InputIt first, InputIt last, UnaryPredicate p) {
13  for (; first != last; ++first) {
14  if (p(*first)) {
15  return first;
16  }
17  }
18  return last;
19 }
20 }
Definition: cexpr_algs.hpp:3
constexpr InputIt find_if(InputIt first, InputIt last, UnaryPredicate p)
Definition: cexpr_algs.hpp:12
constexpr InputIt find(InputIt first, InputIt last, const T &value)
Definition: cexpr_algs.hpp:4