Boost logo

Boost :

From: cppljevans_at_[hidden]
Date: 2003-10-04 16:59:54

On 10/01/2003 09:17 PM, Fernando Cacciola wrote:
> FWIW, this is already supported by Boost.Optional.
> The syntax is: in_place(a0,a1,a2), or in_place<T>(a0,a1,a2) for Variant.
> The code is already in main CVS: boost/detail/in_place_factory.hpp and typed_inplace_factory.hpp
I'm having trouble using this code. The attachment contains what I
want to do with in_place<T>, but somehow, I can't figure how to
used in_place(a0,a1,a2) instead of new_policied(a0,a1,a2). In other
words, just as in_place can be followed by an arbitrary number of
parameters up to a maximum (I think), I'd like somehow to do the
same with new_policied. The purpose of new_policied is to avoid
some of the dangers of shifted pointer by explicitly allocating
the StoragePolicy along with the Referent, and storing the result
in auto_ptr. This auto_ptr would then be passed to the shifted_ptr
CTOR; thus assuring the StoragePolicy preceded the Referent.
The StoragePolicy might be reference counting or reference linking
or shifted_ptr's shifted_header or just a bit for mark-scan garbage

Any ideas how to enable an arbitrary number and types of args to
new_policied CTOR?

Boost list run by bdawes at, gregod at, cpdaniel at, john at