|
Boost : |
From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-09 01:00:07
--- Rainer Deyke <rainerd_at_[hidden]> wrote:
> I can think of at least one degenerate case where your trick fails.
>
> class A;
>
> A* the_A = 0;
>
> class A {
> A() { the_A = this; }
> ~A() { the_A = 0; }
> };
>
> class B {
> B() { if (the_A) do_something_with(the_A); }
> };
>
> variant<A, B> v(A());
> v = B();
>
It'll fail as soon as you use placement 'new'
regadless of this trick.
The current boost::variant uses placement
'new' all the time.
Eugene
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk