$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-02-25 08:13:18
David Abrahams wrote:
> "Fernando Cacciola" <fcacciola_at_[hidden]> writes:
>
>> No, right're right :-)
>> Is perfectly possible to simply discard it, though to me it looks
>> kind of akward in anything but deeply low-level code.
>>
>> Anyway, doesn't this require a definition of placement operator new
>> for each T?
>
> I don't know, possibly so. It's been so long I've forgotten more than
> I ever knew ;-)
It only requires
template<class T> void * operator new(size_t n, optional<T> & t);
I think.
One problem is that there is no reliable way to prevent
optional<X> opt;
new(opt) Y; // oops
since the type being created is not communicated to operator new, only its
size is.