Filter Operators - cemderv/linq GitHub Wiki

where()

Returns all elements for which a given predicate is fulfilled.

Signature:

template <typename TPredicate>
range where(const TPredicate& predicate) const;

Example:

const vector numbers { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };

auto query = linq::from(&numbers)
                  .where( [](int i) { return i > 6; } );

for (const int i : query) {
    print("{} ", i);
}

Output: 7 8 9 10