3 #if !defined(CPPLINQ_LINQ_SELECT_HPP) 4 #define CPPLINQ_LINQ_SELECT_HPP 11 template <
class Collection,
class Selector>
14 typedef typename Collection::cursor
18 typedef typename util::result_of<Selector(typename inner_cursor::element_type)>::type
20 typedef typename std::remove_reference<reference_type>::type
22 typedef typename inner_cursor::cursor_category
25 cursor(
const inner_cursor& cur, Selector sel) : cur(cur), sel(std::move(sel)) {}
28 bool empty()
const {
return cur.empty(); }
29 void inc() { cur.inc(); }
32 bool atbegin()
const {
return cur.atbegin(); }
33 void dec() { cur.dec(); }
35 void skip(std::size_t n) { cur.skip(n); }
36 std::size_t
position()
const {
return cur.position(); }
37 std::size_t
size()
const {
return cur.size(); }
43 linq_select(
const Collection& c, Selector sel) : c(c), sel(sel) {}
54 #endif // defined(CPPLINQ_LINQ_SELECT_HPP) Definition: linq_select.hpp:12
std::remove_reference< reference_type >::type element_type
Definition: linq_select.hpp:21
bool atbegin() const
Definition: linq_select.hpp:32
cursor get_cursor() const
Definition: linq_select.hpp:45
void skip(std::size_t n)
Definition: linq_select.hpp:35
cursor(const inner_cursor &cur, Selector sel)
Definition: linq_select.hpp:25
inner_cursor::cursor_category cursor_category
Definition: linq_select.hpp:23
void dec()
Definition: linq_select.hpp:33
std::size_t size() const
Definition: linq_select.hpp:37
linq_select(const Collection &c, Selector sel)
Definition: linq_select.hpp:43
void inc()
Definition: linq_select.hpp:29
util::result_of< Selector(typename inner_cursor::element_type)>::type reference_type
Definition: linq_select.hpp:19
void forget()
Definition: linq_select.hpp:27
std::size_t position() const
Definition: linq_select.hpp:36
Definition: linq_select.hpp:17
bool empty() const
Definition: linq_select.hpp:28