[Exceptions] Custom type in error_info value?

This is the test program I would like to be explained to me: #include <iostream> #include <string> #include <boost/exception.hpp> struct MyException: virtual boost::exception{ }; class MyClass { char* s; public: MyClass(const char* msg) : s(strdup(msg)){ } MyClass(const MyClass& c){ s = strdup(c.s); } ~MyClass(){ free(s); } }; void main() { MyException ex; ex << boost::error_info<struct my_tag1, MyClass>("qweqwe"); ex << boost::error_info<struct my_tag2, std::string>("asdasd"); std::cout << boost::diagnostic_information(ex); } This is the program output:
Throw in function (unknown) Dynamic exception type: struct MyException [PAUmy_tag1@?1?main@] = [ type: ?AV?$error_info@Umy_tag1@?1?main@VMyClass @@@boo t@@, size: 8, dump: 50 69 10 01 b8 18 7f 00 ] [PAUmy_tag2@?1?main@] = asdasd
So, my question: what should I do with 'MyClass' to see the output like this:
Throw in function (unknown) Dynamic exception type: struct MyException [PAUmy_tag2@?1?main@] = qweqwe (Wow !!! Terrible dump is replaced with readable string here !!!???) [PAUmy_tag2@?1?main@] = asdasd
Thanks, Andrew.

2010/2/28 Andrew Chinkoff <achinkoff@gmail.com>:
So, my question: what should I do with 'MyClass' to see the output like this:
Throw in function (unknown) Dynamic exception type: struct MyException [PAUmy_tag2@?1?main@] = qweqwe (Wow !!! Terrible dump is replaced with readable string here !!!???) [PAUmy_tag2@?1?main@] = asdasd
See http://www.boost.org/doc/libs/release/libs/exception/doc/diagnostic_informat.... Emil Dotchevski Reverge Studios, Inc. http://www.revergestudios.com/reblog/index.php?n=ReCode

Thanks! 2010/3/1 Emil Dotchevski <emildotchevski@gmail.com>
2010/2/28 Andrew Chinkoff <achinkoff@gmail.com>:
So, my question: what should I do with 'MyClass' to see the output like this:
Throw in function (unknown) Dynamic exception type: struct MyException [PAUmy_tag2@?1?main@] = qweqwe (Wow !!! Terrible dump is replaced with readable string here !!!???) [PAUmy_tag2@?1?main@] = asdasd
See http://www.boost.org/doc/libs/release/libs/exception/doc/diagnostic_informat... .
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
participants (2)
-
Andrew Chinkoff
-
Emil Dotchevski