|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2002-08-09 11:08:11
From: "Rob Stewart" <stewart_at_[hidden]>
> From: "David Abrahams" <dave_at_[hidden]>
> >
> > From: "Rob Stewart" <stewart_at_[hidden]>
> > > Wouldn't "raise" be a better name than "throw?"
> >
> > Why? In C++, exceptions aren't "raised", they're "thrown".
>
> Because they aren't necessarily thrown with this approach. Thus, we
"raise" an
> exception which might mean the exception is thrown, it might trigger an
assert,
> or it might do something else the user has determined.
Hmm, that's a bit subtle for my tastes. I like the idea that we're writing
for standard C++, and that we just turn "throw" into something else for
crippled platforms.
Another factor to consider: some libraries with built products may want to
wrap throws in a function call
throw_my_exception()
There are various reasons for that, not least that GCC's new ABI has some
problems with throwing exceptions across shared library boundaries on
Linux, so if the catch handler is also in the library you might need to do
it. It also saves code in the client.
I'm not sure Peter's suggestion can be made to cover that case.
-Dave
-----------------------------------------------------------
David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk