Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-08 11:51:28


I think the right fix is to check

    is_convertible<add_reference<VBase>::type,
                    add_reference<boost::named_template_param_base>::type>

instead. Jeremy, this is one of yours. What do you think?

----- Original Message -----
From: "Toon Knapen" <toon.knapen_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, January 08, 2002 10:34 AM
Subject: [boost] indirect_iterator_adaptors over abstract classes

> 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) ?
>
>
>
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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