Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext
none
Description

For a sequence seq and unary function object f, none returns true if f returns false for every element of seq.

Synopsis
template<
    typename Sequence,
    typename F
    >
typename result_of::none<Sequence,F>::type none(
    Sequence const& seq, F f);

Table1.41.Parameters

Parameter

Requirement

Description

seq

A model of Forward Sequence, f(e) is a valid expression, convertible to bool, for every element e in seq

The sequence to search

f

A unary function object

The search predicate


Expression Semantics
none(seq, f);

Return type: bool

Semantics: Returns true if and only if f(e) evaluates to false for every element e in seq. Result equivalent to !any(seq, f).

Complexity

Linear. At most result_of::size<Sequence>::value comparisons.

Header
#include <boost/fusion/algorithm/query/none.hpp>
#include <boost/fusion/include/none.hpp>
Example
struct odd
{
    template<typename T>
    bool operator()(T t) const
    {
        return t % 2;
    }
};
...
assert(none(make_vector(2,4), odd()));
assert(!none(make_vector(1,2), odd()));

PrevUpHomeNext