Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-05 12:12:35

operator[] shouldn't be instantiated unless you try to use it. Why are you
trying to use it?
           David Abrahams * Boost Consulting
dave_at_[hidden] *

----- Original Message -----
From: "Yitzhak Sapir" <yitzhaks_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, September 05, 2002 2:08 PM
Subject: [boost] iterator adaptors and operator[]

> I have a list of pointers (shared pointers, in this case) to some
abstract class. But I can't (on MSVC 6.5) use an indirect iterator adaptor
on this class, even if I define an indirect iterator adaptor whose category
is forward_iterator_tag, and this is because of operator[]. This operator
attempts to instantiate a value which, because the class is abstract,
cannot be instantiated.
> I think this is (or should be considered) a common use case: a container
of pointers to an abstract class.
> And I think using indirect_iterator to access the abstract class might
also be a common thing to do with this container.
> But unfortunately, it doesn't work.
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at