Modify

Opened 16 years ago

Closed 12 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

Attachments (0)

Change History (2)

comment:1 Changed 16 years ago by sielenk

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 Changed 12 years ago by david_abrahams

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain david_abrahams.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.