Boost logo

Boost :

From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-07-16 09:36:01


David Abrahams wrote:
> "Calum Grant" <calum_at_[hidden]> writes:
>>In the absence of Boost, I would probably use a std::auto_ptr to
>>store an optional field, which is, um, a smart pointer. I realize
>>that Optional is implemented slightly differently.
>
>
> I wouldn't characterize it as a "slight" difference.
>
I hate extra dynamic memory allocation even more than I hate extra
copies, because the former cannot be optimized out and usually takes
more time than 10 extra copies. Well, pool allocators help a lot
sometimes, but it's an optimization technology.

I like Boost.Optional because it offers a good way to deal with
optonality without any extra pointers, memory allocations, special
"NULL" values or construction or copy operations . I think it's way
different from the concept of smart pointers.

Andrey


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