I apologize for the late reply. It seems like Steven is right, there is no
way to make this work. I had two ideas that I tried:
1) I tried to use operator= to copy the virtual bases after the clone_impl
constructor has initialized them using their default constructors
(unfortunately). This makes the test case Michael posted work, however
operator= is not available for types that contain members of reference
types. I don't know how common this situation is, but in the
boost::exception tests I did have such exceptions (not on purpose) which
maybe means it isn't too unusual.
2) My other idea was instead of operator= to call ~T(), then the T copy
constructor with placement new over the T sub-object of clone_impl<T>. This
duly crashed the test program, which isn't all that surprising but it was
worth a try. :)
Emil
On Thu, Apr 11, 2013 at 8:27 AM, Steven Watanabe
AMDG
On 04/11/2013 08:17 AM, Steven Watanabe wrote:
On 04/10/2013 11:04 PM, Michael Caisse wrote:
The basic problem I'm experiencing is that getting an exception_ptr results inherited parameters getting lost when virtual inheritance is used.
<snip>
The only way to make it work is to restructure clone_impl to use the compiler generated copy constructor.
...and the templated constructor is not a copy constructor. It's impossible to make this work.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users