Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-03-27 17:33:27


The never-empty requirement for Boost Variant requires memory
allocation in general, in the implementation of operator=, as
discussed here:

http://www.boost.org/doc/html/variant/design.html#variant.design.never-empty

The same page states that future implementations might use
policy-based design to specify custom allocator.

Assuming that it is desirable to allow for allocations to be
customized, wouldn't it be better to use the same technique as in the
custom allocator support in shared_ptr and in the version of
boost::function that Doug just committed to the SVN trunk?

In this case, the allocator wouldn't be provided as a policy to the
variant template itself, but would appear as template parameter of its
constructor and operator=.

--
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode

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