Boost logo

Boost :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-06-30 15:50:43


I thought that you were reporting that one of the examples from the
documentation doesn't compile (which they all do). I got your point
though: you're saying that when you derive both boost::exception and
std::exception, and you didn't override what(), you'd get ambiguity
problems.

Recently, I had moved the functionality which used to be handled
through boost::exception::what, to a separate function, called
diagnostic_information, which is a more appropriate name. I had left
boost::exception::what in, for convenience (so that you can call it
through a boost::exception reference.)

Your post and my own experience has convinced me that it's better to
get rid of boost::exception::what altogether. Now you shouldn't be
getting the error (try revision 46930.)

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode

On Sun, Jun 29, 2008 at 11:58 PM, Kowalke Oliver (QD IT PA AS)
<Oliver.Kowalke_at_[hidden]> wrote:
> compiler tells:
>
> /home/kowalke/Projects/odb/src/main.cpp:1330: error: request for member 'what' is ambiguous
> /usr/include/c++/4.2/exception:64: error: candidates are: virtual const char* std::exception::what() const
> /opt/boost/include/boost-1_35/boost/exception/exception.hpp:52: error: virtual const char* boost::exception::what() const
>
>
> code line:
>
> catch ( my_error const& e)
> { std::cout << "my_error: " << e.what() << std::endl; }
>
> Oliver
>
>> From: boost-bounces_at_[hidden]
>> [mailto:boost-bounces_at_[hidden]] On Behalf Of Emil Dotchevski
>> Sent: Monday, June 30, 2008 8:48 AM
>> To: boost_at_[hidden]
>> Subject: Re: [boost] [exception] - bug in tutorial -> member
>> 'what' is ambiguous?
>>
>> Do you have a log with the error?
>>
>> To best of my knowledge, all examples (which can also be found in
>> libs/exception/example) from the Boost Exception
>> documentation compile without errors.
>>
>> Emil Dotchevski
>> Reverge Studios, Inc.
>> http://www.revergestudios.com/reblog/index.php?n=ReCode
>>
>>
>> On Sun, Jun 29, 2008 at 11:13 PM, Kowalke Oliver (QD IT PA
>> AS) <Oliver.Kowalke_at_[hidden]> wrote:
>> > Hi,
>> > I revering to
>> >
>> http://svn.boost.org/svn/boost/trunk/libs/exception/doc/tutorial_trans
>> > porting_data.html First example: class my_error: public
>> >
>> boost::exception<http://svn.boost.org/svn/boost/trunk/libs/exception/d
>> > oc/exception.html>, public std::exception { }; //(2) This
>> code line produces the error.
>> > Oliver
>> >
>> > On 6/18/08, Kowalke Oliver (QD IT PA AS) <Oliver.Kowalke
>> <at> qimonda.com> wrote:
>> >> Yes I used the latest documentation from trunk:
>> >> Tutorial: Transporting of Abritrary Data to the Catch Site:
>> >>
>> >> class my_error : public boost::exception , std::exception {);
>> >>
>> >> Does not work with gcc-4.2.4 (compiler bug?).
>> >
>> > What exactly doesn't work on gcc-4.2.4?
>> >
>> > All of the examples from the documentation are in this folder:
>> >
>> > http://svn.boost.org/svn/boost/trunk/libs/exception/example/
>> >
>> > The examples compile with msvc and gcc 4.3.1. I also looked at
>> >
>> >
>> http://svn.boost.org/svn/boost/trunk/libs/exception/doc/transporting_d
>> > ata.html
>> >
>> > I don't see a reference to what() in it.
>> >
>> > Emil Dotchevski
>> > Reverge Studios, Inc.
>> > http://www.revergestudios.com/reblog/index.php?n=ReCode
>> >
>> >> On Tue, Jun 17, 2008 at 12:09 AM, Kowalke Oliver (QD IT
>> PA AS) <Oliver.Kowalke <at> qimonda.com> wrote:
>> >> > Hi,
>> >> > I'm using boost.exception from trunk and I get
>> following error (gcc-4.2.4):
>> >> >
>> >> > error: request for member 'what' is ambiguous >
>> >> /usr/include/c++/4.2/exception:64: error: candidates are:
>> virtual >
>> >> const char* std::exception::what() const >
>> >>
>> /opt/boost/include/boost-1_35/boost/exception/exception.hpp:52: error:
>> >> > virtual const char* boost::exception::what() const >
>> > I'm using
>> >> the code from the boost.exception tutorial:
>> >> >
>> >> > class error
>> >> > :
>> >> > public boost::exception,
>> >> > public std::exception
>> >> > {}
>> >> >
>> >> > ...
>> >> > try
>> >> > {...}
>> >> > catch ( error const& e)
>> >> > { std::cout << "error: " << e.what() << std::endl; }
>> >>
>> >> Where do you read the tutorial you are mentioning? Is it possible
>> >> that it is out of date? The latest
>> > documentation can be accessed directly through the
>> subversion web interface:
>> >>
>> >>
>> http://svn.boost.org/svn/boost/trunk/libs/exception/doc/boost-
>> exception.html.
>> >>
>> >> Emil Dotchevski
>> >> Reverge Studios, Inc.
>> >> http://www.revergestudios.com/reblog/index.php?n=ReCode
>> >>
>> >> _______________________________________________
>> >> Unsubscribe & other changes:
>> >> http://lists.boost.org/mailman/listinfo.cgi/boost
>> >> _______________________________________________
>> >> Unsubscribe & other changes:
>> >> http://lists.boost.org/mailman/listinfo.cgi/boost
>> > _______________________________________________
>> > Unsubscribe & other changes:
>> > http://lists.boost.org/mailman/listinfo.cgi/boost
>> >
>> >
>> >
>> > _______________________________________________
>> > Unsubscribe & other changes:
>> > http://lists.boost.org/mailman/listinfo.cgi/boost
>> >
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk