oven::exists
existsは、範囲のいずれかの要素が述語を満たすかどうか判定するアルゴリズムです。
C++0xのstd::any_ofに相当します。
#include <vector> #include <pstade/oven/initial_values.hpp> #include <pstade/oven/exists.hpp> using namespace pstade::oven; bool is_odd(int n) { return n % 2 == 0; } int main() { const std::vector<int> v = initial_values(1, 2, 3); const bool result = exists(v, &is_odd); // true }
【参照】
pstade::oven::exists