13 Jun
2017
13 Jun
'17
6:12 a.m.
On Mon, Jun 12, 2017 at 10:54 PM, Vicente J. Botet Escriba via Boost < boost@lists.boost.org> 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.