Changeset View
Changeset View
Standalone View
Standalone View
src/rwcollection.h
Show All 31 Lines | public: | ||||
const T *operator->() const { return collection; } | const T *operator->() const { return collection; } | ||||
/** | /** | ||||
* Iterator mechanics. | * Iterator mechanics. | ||||
*/ | */ | ||||
typedef typename boost::range_iterator<T>::type iterator; | typedef typename boost::range_iterator<T>::type iterator; | ||||
iterator begin() { return std::begin(*collection); } | iterator begin() { return std::begin(*collection); } | ||||
iterator end() { return std::end(*collection); } | iterator end() { return std::end(*collection); } | ||||
std::reverse_iterator<iterator> rbegin() { return collection->rbegin(); } | std::reverse_iterator<iterator> rbegin() { | ||||
std::reverse_iterator<iterator> rend() { return collection->rend(); } | return std::rbegin(*collection); | ||||
} | |||||
std::reverse_iterator<iterator> rend() { return std::rend(*collection); } | |||||
typedef typename boost::range_iterator<const T>::type const_iterator; | typedef typename boost::range_iterator<const T>::type const_iterator; | ||||
const_iterator begin() const { return std::begin(*collection); } | const_iterator begin() const { return std::begin(*collection); } | ||||
const_iterator end() const { return std::end(*collection); } | const_iterator end() const { return std::end(*collection); } | ||||
std::reverse_iterator<const_iterator> rbegin() const { | std::reverse_iterator<const_iterator> rbegin() const { | ||||
return collection->rbegin(); | return std::rbegin(*collection); | ||||
} | } | ||||
std::reverse_iterator<const_iterator> rend() const { | std::reverse_iterator<const_iterator> rend() const { | ||||
return collection->rend(); | return std::rend(*collection); | ||||
} | } | ||||
/** | /** | ||||
* Forward bracket operator. | * Forward bracket operator. | ||||
*/ | */ | ||||
template <typename I> typename BracketType<I>::type operator[](I &&index) { | template <typename I> typename BracketType<I>::type operator[](I &&index) { | ||||
return (*collection)[std::forward<I>(index)]; | return (*collection)[std::forward<I>(index)]; | ||||
} | } | ||||
Show All 26 Lines |