Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/tr1/detail/functor2iterator.hpp @ 125:34e428693f5d vext
Vext -> Repoint
author | Chris Cannam |
---|---|
date | Thu, 14 Jun 2018 11:15:39 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 // (C) Copyright John Maddock 2005. |
Chris@16 | 2 // Use, modification and distribution are subject to the |
Chris@16 | 3 // Boost Software License, Version 1.0. (See accompanying file |
Chris@16 | 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 5 |
Chris@16 | 6 #ifndef BOOST_TR1_FUNCTOR_IT_HPP_INCLUDED |
Chris@16 | 7 # define BOOST_TR1_FUNCTOR_IT_HPP_INCLUDED |
Chris@16 | 8 |
Chris@16 | 9 # include <boost/iterator/iterator_facade.hpp> |
Chris@16 | 10 |
Chris@16 | 11 namespace boost{ namespace tr1_details{ |
Chris@16 | 12 |
Chris@16 | 13 template <class Func, class R> |
Chris@16 | 14 struct functor2iterator : boost::iterator_facade<functor2iterator<Func,R>, const R, std::input_iterator_tag> |
Chris@16 | 15 { |
Chris@16 | 16 functor2iterator() : m_func(0){} |
Chris@16 | 17 functor2iterator(Func& f) |
Chris@16 | 18 : m_func(&f) |
Chris@16 | 19 { |
Chris@16 | 20 m_val = (*m_func)(); |
Chris@16 | 21 } |
Chris@16 | 22 const R& dereference()const |
Chris@16 | 23 { return m_val; } |
Chris@16 | 24 void increment(){ m_val = (*m_func)(); } |
Chris@16 | 25 bool equal(const functor2iterator&)const |
Chris@16 | 26 { return false; } |
Chris@16 | 27 private: |
Chris@16 | 28 Func* m_func; |
Chris@16 | 29 R m_val; |
Chris@16 | 30 }; |
Chris@16 | 31 |
Chris@16 | 32 } } |
Chris@16 | 33 |
Chris@16 | 34 #endif |