|
Boost : |
Subject: Re: [boost] [Core] BOOST_TRY/BOOST_CATCH
From: Chris Glover (c.d.glover_at_[hidden])
Date: 2016-02-21 21:05:40
On Sun, 21 Feb 2016 at 19:06 Andrey Semashev <andrey.semashev_at_[hidden]>
wrote:
> On 2016-02-21 23:15, Chris Glover wrote:
>
> I think so, yes. I would just use an #ifdef.
>
> The problem with these macros (for me, at least) is that it's not clear
> what the actual error handling is supposed to be in case if exceptions
> are disabled. I mean, if you want the code to support the "no
> exceptions" case, you should design the interfaces with a different
> method of communicating failures, and simply removing try/catch/throw
> does not cut it.
>
>
Yes, I agree with your point of view from a theoretical perspective. In
reality, we don't don't need handle the exceptional case because we control
all of inputs so we just need the code to compile and run the try block. I
think it's fair, and most would understand, that if you're compiling with
exceptions disabled then you're on your own.
What I want is for code using try/catch/throw to compile fine, but call
terminate when encountering a throw.
Anyway, thank you for the advice, I'll give this all some thought.
-- chris
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk