
Oh, ok, I think I got this! Thank you very much for your help.
On Fri, Nov 29, 2013 at 3:23 AM, Emil Dotchevski
On Thu, Nov 28, 2013 at 3:29 AM, Egor Tensin
wrote: Steven,
Could you please specify, you meant the error_info_injector class inside the Boost.Exception? I'm just trying to get this straight in my head. Or maybe you don't know what class exactly derives from the class passed as the parameter?
Allow me -- calling boost::throw_exception throws an internal type that derives from the type of the passed object. As in the example below, that internal type's constructor initializes the virtual bases of the object, but it doesn't know about the virtual bases of the object -- so they get initialized by their *default* constructor.
#include <iostream> struct a { int v; a(int v): v(v) { } }; struct b: virtual a { b(): a(1) { } }; struct c: b { c(): a(2) { } }; int main() { c x; std::cout << x.v; //prints "2" return 0; }
-- Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users