Boost logo

Boost :

Subject: Re: [boost] Noexcept
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2017-06-13 06:12:39


On Mon, Jun 12, 2017 at 10:54 PM, Vicente J. Botet Escriba via Boost <
boost_at_[hidden]> wrote:

> However if Noexcept doesn't require a return_<T> then it is much difficult
> to force the use of the try functions.

In Noexcept, it is not correct to always use try_, for the same reason you
don't always use try with exception handling. That is only used if you want
to _handle_ errors, not just check for errors; see the second Q&A here:
https://zajo.github.io/boost-noexcept/#qanda.

Error checking with Noexcept depends on your choice of return type. For
example, if your return type is T *, you'd check for 0, if your return type
is shared_ptr<T> or optional<T>, you'd check using the conversion to bool.


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