Boost variant and memory allocations

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
participants (1)
-
Emil Dotchevski