...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Generate satisfies() predicate.
A wrapper around user-defined UnaryPredicate checking if Value should be returned by spatial query.
template<
typename UnaryPredicate
>
unspecifiedsatisfies
(
UnaryPredicate const &
pred
)
Parameter |
Description |
---|---|
|
A type of unary predicate function or function object. |
Type |
Name |
Description |
---|---|---|
|
|
The unary predicate function or function object. |
bool is_red(Value const& v) { return v.is_red(); } struct is_red_o { template <typename Value> bool operator()(Value const& v) { return v.is_red(); } } // ... rt.query(index::intersects(box) && index::satisfies(is_red), std::back_inserter(result)); rt.query(index::intersects(box) && index::satisfies(is_red_o()), std::back_inserter(result)); rt.query(index::intersects(box) && index::satisfies([](Value const& v) { return v.is_red(); }), std::back_inserter(result));