Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::throw_exception(...) behaviour and use case
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2014-05-22 13:28:46


On Thu, May 22, 2014 at 8:24 AM, Arindam Mukherjee
<arindam.mukerjee_at_[hidden]> wrote:
> I was wondering what behaviour or idiom does boost::throw_exception
> enable. I must be dense but the documentation here
> (http://www.boost.org/doc/libs/1_55_0/libs/exception/doc/throw_exception.html)
> does not immediately ring a bell. Is it meant to somehow help write
> code that runs both in environments where exceptions are enabled and
> where they are not?

1) It enables library developers to write code that can run in both
environments.

2) It enables users of libraries that throw by boost::throw_exception
to write programs targeting exception-free environments.

3) It enables the rest of the Boost Exception functionality:
exception_ptr and transporting arbitrary data in exception objects.

Note that in 2) the program itself is specifically designed to target
exception-free environments, the developer being aware of the exact
conditions under which libraries call boost::throw_exception.

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

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