3 #if !defined(CPPLINQ_LINQ_WHERE_HPP) 4 #define CPPLINQ_LINQ_WHERE_HPP 9 template <
class Collection,
class Predicate>
12 typedef typename Collection::cursor
18 typename inner_cursor::cursor_category>::type
20 typedef typename inner_cursor::element_type
22 typedef typename inner_cursor::reference_type
25 cursor(
const inner_cursor& cur,
const Predicate& p) : cur(cur), pred(p)
27 if (!cur.empty() && !pred(cur.get())) {
33 bool empty()
const {
return cur.empty(); }
37 if (cur.empty() || pred(cur.get()))
break;
48 if (pred(cur.get()))
break;
56 linq_where(
const Collection& c, Predicate pred) : c(c), pred(pred) {}
59 return cursor(c.get_cursor(), pred);
68 #endif // !defined(CPPLINQ_LINQ_WHERE_HPP) util::min_iterator_category< bidirectional_cursor_tag, typename inner_cursor::cursor_category >::type cursor_category
Definition: linq_where.hpp:19
bool atbegin() const
Definition: linq_where.hpp:44
void dec()
Definition: linq_where.hpp:45
cursor(const inner_cursor &cur, const Predicate &p)
Definition: linq_where.hpp:25
cursor get_cursor() const
Definition: linq_where.hpp:58
linq_where(const Collection &c, Predicate pred)
Definition: linq_where.hpp:56
inner_cursor::element_type element_type
Definition: linq_where.hpp:21
Definition: linq_cursor.hpp:65
Definition: linq_where.hpp:15
void forget()
Definition: linq_where.hpp:32
Definition: linq_where.hpp:10
void inc()
Definition: linq_where.hpp:34
inner_cursor::reference_type reference_type
Definition: linq_where.hpp:23
bool empty() const
Definition: linq_where.hpp:33