Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-01-02 23:21:52


"Daryle Walker" <darylew_at_[hidden]> wrote in message
news:BC1B2854.45EB%darylew_at_hotmail.com...
> On 1/1/04 9:58 PM, "Thorsten Ottosen" <nesotto_at_[hidden]> wrote:

[snip]

> > There is no requierement about the objects being polymorphic.
>
> I know that, but I don't think that the non-polymorphic cases are useful.
> If all the elements are the same type, you can use a standard container.

there's still some benefits of using a pointer container.

> If
> the elements are of differing un-related types, then you are restricted in
> what you can do (like no deletion) unless you give element-pointers the
> properties of full-blown smart pointers, which is probably overkill for
most
> applications.
>
> Are there common cases where you would need non-polymorphic capability?

The thing that got me started was a voice commuincation app that had a
map<string, Socket*> member. I assume that the programmer had reason
for using the pointers; perhaps the socket was not assigneable.

br

Thorsten


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