Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::get_error_info not found!?
From: Adam Romanek (a.romanek_at_[hidden])
Date: 2011-05-13 01:39:34


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_info<ExceptionTags::ErrorCodeTag>(ce));
> }
>
> I'm using boost version 1.42. Thanks in advance.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net