David Abrahams wrote:
> "Fernando Cacciola" <[EMAIL PROTECTED]> 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.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to