Opened 21 years ago

Closed 17 years ago

#13 closed Bugs (Out of Date)

iterator_adapter and abstract classes

Reported by: sielenk Owned by: david_abrahams
Milestone: Component: iterator
Version: None Severity:
Keywords: Cc:

Description

Footnote [5] on the
Boost Iterator Adaptor Library
documentation page states that 
> The value_type of an iterator may not be
> an abstract base class, [...]
This is not true.

The value_type is only used as result type of operator[], so there ought to be no problem if the iterator is used as bidirectional and not as random access iterator.

The problem was caused by the structs
is_named_parameter and make_arg.

I changed
  is_convertible<Value,named_template_param_base>
to
  is_convertible<Value*,named_template_param_base*>
two times and everyting works beautifully,
i.e. the appended file compiles.

MfG Marvin H. Sielenkemper

Change History (2)

comment:1 by sielenk, 21 years ago

Logged In: YES 
user_id=72183

The seems to be a problem attaching files ...
I'll put the important parts in here (Base is a class with purely virtual functions):

typedef std::vector<Base *> Vector;

typedef boost::indirect_iterator_generator<
    Vector::iterator,
    Base,
    boost::iterator_category_is<
        std::bidirectional_iterator_tag
    >
>::type Iterator;

boost::function_requires<
    boost::Mutable_BidirectionalIteratorConcept<
        Iterator
    >
>();

comment:2 by david_abrahams, 17 years ago

Status: assignedclosed
Logged In: YES 
user_id=52572

The library has been completely rewritten; the footnote in
question no longer exists, and as far as I know, the
capability in question is enabled in the new version of the
library.
Note: See TracTickets for help on using tickets.