boost::get_error_info not found!?

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.

Hi there, please attach the error message the compiler produces. Also, what's the definition of ErrorCodeInfo, because I can't see it. wbr, Adam Romanek On 05/12/2011 05:36 PM, Germán Diago wrote:
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. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

namespace ExceptionTags { struct ErrorCodeTag {}; }
please attach the error message the compiler produces. Also, what's the definition of ErrorCodeInfo, because I can't see it.
wbr, Adam Romanek
Sorry, I forgot it to include it. Here you are.
namespace ExceptionTags {
struct ErrorCodeTag {};
}
typedef boost::error_info
participants (2)
-
Adam Romanek
-
Germán Diago