
5 Oct
2010
5 Oct
'10
8:56 p.m.
Rutger ter Borg wrote:
However, it seems that cases which are usually space-efficient optionals
(e.g., ptrs in the form of a null-ptr) do not have template specializations.
In case this applies to your use case: http://cctbx.svn.sourceforge.net/viewvc/cctbx/trunk/tbxx/optional_copy.hpp?revision=11570&view=markup Stores a null pointer if the value is not defined, uses "new" to allocate space for a value if given. This has been very useful for managing objects that are rarely needed: the memory overhead is just one pointer for the common case when the object is not needed. Ralf