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> rend() { return (*collection).rend(); } | |||||
deadalnix: Use -> | |||||
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 { | |||||
return (*collection).rbegin(); | |||||
} | |||||
std::reverse_iterator<const_iterator> rend() const { | |||||
return (*collection).rend(); | |||||
} | |||||
/** | /** | ||||
* 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 25 Lines |
Use ->