
12 May
2011
12 May
'11
3:36 p.m.
Hello. I have this code and I can't find out why it won't compile. I have looked at it several times and I can't find the reason. My definitions: enum ErrorCode { Success, BadOptions = -1, CannotConnect = -3 }; class ConsoleException : virtual public boost::exception, virtual public std::exception {}; namespace ExceptionTags { struct ErrorCodeTag {}; } My throw: BOOST_THROW_EXCEPTION(CabConsoleException() << ErrorCodeInfo(BadOptions)); And in main: try { CabConsole2 console; console.run(argc, argv); } catch (boost::exception & ce) { return 0; return *(boost::get_error_infoExceptionTags::ErrorCodeTag(ce)); } I'm using boost version 1.42. Thanks in advance.