Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2002-01-08 10:34:04


Using an indirect_iterator_adaptor over a vector of pointers to virtual
base classes is not possible although it should technically by possible
AFAIK.

e.g.
\begin{example_code}

#include <boost/iterator_adaptors.hpp>
#include <vector>

class VBase
{
public:
         virtual void foo() const = 0;

};

int main()
{
   typedef std::vector< VBase* > VBases;
   typedef boost::indirect_iterator_generator< VBases::const_iterator
>::type VBaseIterator;

   VBases container;
   VBaseIterator it( container.begin() );
}
\end{example_code}

does not compile (tried with gcc) because of

\begin{error_msg}
/usr/local/boost/boost/type_traits/conversion_traits.hpp:166: cannot declare
    variable `boost::is_convertible<VBase,
    boost::named_template_param_base>::_m_from' to be of type `VBase'
\end{error_msg}

It does neither work when I declare the value_type to be a A& in the
indirect_iterator_generator (ref to ref problem) ?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk