
David Abrahams wrote:
"Calum Grant" <calum@visula.org> 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