
17 Jun
2009
17 Jun
'09
2:18 p.m.
2009/6/17 Maxim Koshelev
In common case it is not compiller solution due to complexity of constructors/destructors of holded class.
variant v( B() );
Note that this code does not create an instance of variant, but declares a function.
this code MUST call constructor of class B two times. First time when B is created, second time when just created instance of B copyied to variant. Valid solution is use type-traits. Something like:
variant v( Trait<B>())
Same here. Roman Perepelitsa.