1 #ifndef FUNC_ITERATOR_H_ 2 #define FUNC_ITERATOR_H_ 8 template <
typename TIterator,
typename TFunctor >
24 return m_f(this->Base::operator*());
34 template <
typename TContainer,
typename TFunctor >
43 explicit func_iterator(
const typename TContainer::iterator & i) : Base(i) {}
45 func_iterator(
const typename TContainer::iterator & i, TFunctor f) : Base(i,f) {}
51 template <
typename TContainer,
typename TFunctor >
66 template <
typename TFunctor,
typename TIterator >
68 func_it(TIterator it, TFunctor f = TFunctor())
78 template <
typename TContainer,
typename TFunctor >
94 iterator
begin() {
return iterator(this->Base::begin(), m_f); }
95 iterator
end() {
return iterator(this->Base::end(), m_f); }
96 const_iterator
begin()
const {
return const_iterator(this->Base::begin(), m_f); }
97 const_iterator
end()
const {
return const_iterator(this->Base::end(), m_f); }
99 value_type
operator[](
int i) {
return m_f(this->Base::operator[](i)); }
TFunctor::result_type value_type
const_func_iterator(const typename TContainer::const_iterator &i, TFunctor f)
A functor iterator is an iterator that overload the operator* to a call to a functor on the pointed v...
Belongs to package Box Do not include directly, include til/Box.h instead.
const_func_iterator(const typename TContainer::const_iterator &i)
const_func_iterator(TFunctor f)
const_iterator end() const
detail::func_iterator_impl< typename TContainer::iterator, TFunctor > Base
func_iterator_impl(const TIterator &i)
const_func_iterator< TContainer, TFunctor > const_iterator
func_iterator< TContainer, TFunctor > iterator
const_iterator begin() const
func_iterator(const typename TContainer::iterator &i)
value_type operator[](int i)
func_iterator(const typename TContainer::iterator &i, TFunctor f)
func_iterator(TFunctor f)
func_container(TContainer &c)
TFunctor::result_type value_type
func_iterator_impl(const TIterator &i, TFunctor f)
func_iterator_impl(TFunctor f)
detail::func_iterator_impl< TIterator, TFunctor > func_it(TIterator it, TFunctor f=TFunctor())
A functor iterator is an iterator that overload the operator* to a call to a functor on the pointed v...
A wrapper on stl containers that returns func iterators.
detail::func_iterator_impl< typename TContainer::const_iterator, TFunctor > Base