boost-iterators

transform_iterator compile problem

HI, I don't like posting compile problems, but I really can't figure this one out. Using this code: #include <map> #include <boost/iterator/transform_iterator.hpp> using namespace std; template <typename K, typename V> struct get_value { const V& operator ()(std::pair<K, V> const& p) { return p.second; } }; class test { type...

Compiler error with boost iterator adaptor

I am trying to write a simple STL iterator for CArray MFC class using boost iterator adaptor. This is my code: #include <boost/iterator/iterator_adaptor.hpp> #include <afxtempl.h> class CArrIter : public boost::iterator_adaptor< CArrIter , int, int, boost::random_access_traversal_tag > { public: CArrIter(CArray<int,in...

Using boost::iterator

I wrote a sparse vector class (see #1, #2.) I would like to provide two kinds of iterators: The first set, the regular iterators, can point any element, whether set or unset. If they are read from, they return either the set value or value_type(), if they are written to, they create the element and return the lvalue reference. Thus, ...

iterating getters of a vector of pointers

Hi, I am trying to write an iterator class which returns a getter function return value when it is dereferenced. The code works fine, my only problem is that I would like to write the member_ptr_functor using only one template parameter and not 3, since I am supposed to be able to deduce the types of the argument and return value from th...