Boost logo

Boost :

Subject: Re: [boost] Interest in a "Heterogenous Container" system?
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2009-07-31 13:17:20


Mathias Gaunard wrote:
> Stewart, Robert wrote:
>
> > Yes, containers of shared_ptrs would work, but they add
> > overhead that isn't always wanted.
>
> Then use containers of unique_ptr, like you should (shared_ptr

"like you should" is a rather strong statement.

> is meant for shared ownership or making it easy to fix broken
> code), or use the boost pointer containers if you can't (which
> move semantics mostly render obsolete). You could
> alternatively use boost.any, adobe.poly, clone_ptr, or whatever
> is relevant.

All of those schemes mean that the container interface is in terms of those wrapper types rather than raw pointers. They will work, but they complicate the code using the elements. I'm not suggesting that is onerous, but the interface isn't as simple.

> > The heterogeneous containers, being implemented as class
> > templates, need only be defined in terms of operations
> > supported by its parameterizing types.
>
> This merely looks like a container of Adobe.Poly.

I've never used anything from the Adobe library. You may be right, but why shouldn't Boost provide a clean solution for itself?

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


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