|
Boost : |
Subject: Re: [boost] [function] function wrapping with noexceptionsafetyguarantee
From: Emil Dotchevski (emil_at_[hidden])
Date: 2010-11-02 03:17:20
On Mon, Nov 1, 2010 at 8:58 PM, OvermindDL1 <overminddl1_at_[hidden]> wrote:
> f(unsafe_no_throw,1); // possible new syntax, calls function, no null check
> u(unsafe_no_throw,1); // possible new syntax, whatever the platform
This is somewhat redundant since you can already do
assert(f);
f(1);
I was proposing a similar change, to add a boost::function constructor
that takes std::nothrow_t, which can be used to initialize an empty
function object which asserts and doesn't throw upon calling op().
However I'm not sure there is a use case even for this: it lets you
pick throw or no-throw semantics, but no-throw semantics are only
useful in BOOST_NO_EXCEPTIONS builds, and therefore the global
no-throw behavior supported by boost::throw_exception should be
sufficient.
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk