Boost logo

Boost :

Subject: [boost] [config] Proposed BOOST_NOEXCEPT_NOTHROW macro
From: Beman Dawes (bdawes_at_[hidden])
Date: 2012-08-28 17:22:02


The three current BOOST_NOEXCEPT* macro variants miss the case where
C++03 code has a "throw()" throw-specifier. Classes that derive from
standard library exceptions need this to avoid breaking code on C++03
compilers.

I'm not enamored with the BOOST_NOEXCEPT_NOTHROW name, so feel free to
offer suggestions for alternate names.

Here is the full set of macros:

#ifdef BOOST_NO_NOEXCEPT
# define BOOST_NOEXCEPT
# define BOOST_NOEXCEPT_NOTHROW throw() <---- new macro
# define BOOST_NOEXCEPT_IF(Predicate)
# define BOOST_NOEXCEPT_EXPR(Expression) false
#else
# define BOOST_NOEXCEPT noexcept
# define BOOST_NOEXCEPT_NOTHROW noexcept <---- new macro
# define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
# define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
#endif

Unless there are objections, I'll commit the changes Wednesday
afternoon Eastern US time.

--Beman


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