Boost logo

Boost Users :

Subject: Re: [Boost-users] boost exception tutorial
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-03-31 18:25:42

On Sun, Mar 29, 2009 at 11:25 AM, Robert Ramey <ramey_at_[hidden]> wrote:
> I'm investigating boost exception to see if it is helpful in  a particular
> instance.  I start by looking at the first Tutorial.
> I can't see how this is better than
> struc my_error : public std::exception {
>    int m_ errno;
>    my_error(int errno) :
>        m_errno(errno)
>    {}
> };
> ... throw my_error(errno)
> try {
>    ...
> }
> catch(my_error e){
>    cerr << e;
> }
> What am I missing here? This first example is two compilicated in that it
> requires that I delve into a bunch of other stuff (operator << for exception
> data?) and it doesn't provide any motivation. I think it would be more
> useful if it "spoon fed" the reader (me in this case) a little more.
> Something like:
> Traditional simple example like that above.
> explanation of why the example isn't "good enough"
> simple example reformulated using boost exception
> explanation of how this addresses the short comings of the original version.
> I think this would motivate more users to transition to the library.

I added a Motivation page and a few other tweaks in the documentation.
It'll be out with the 1.39 release but can be viewed right away
through this link:

Emil Dotchevski
Reverge Studios, Inc.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at