Boost logo

Boost :

Subject: Re: [boost] [utility] Proposal to extract some components from Boost.Log
From: Daryle Walker (darylew_at_[hidden])
Date: 2013-09-01 07:06:16


I don’t think you need a “constexpr_if.” You can unconditionally put BOOST_CONSTEXPR in the definition. This will unconditionally add “constexpr” to the member operator (for C++11 systems), which will be ignored if the compiler determines that the attached function (or a particular call) is disqualified from being used in constant expressions. So any extra preprocessor work, or a variant macro, is unnecessary.



Sent from Windows Mail



From: Andrey Semashev
Sent: ‎Sunday‎, ‎September‎ ‎01‎, ‎2013 ‎4‎:‎40‎ ‎AM
To: boost_at_[hidden]


On Sunday 01 September 2013 03:27:06 Daryle Walker wrote:
> > Date: Wed, 28 Aug 2013 12:14:51 +0400
> > From: andrey.semashev_at_[hidden]
> >
> > 1. BOOST_EXPLICIT_OPERATOR_BOOL() macro for defining explicit operator
> > bool() for a class.
>
> a. It isn't marked "constexpr." I can add that myself before using
> "BOOST_EXPLICIT_OPERATOR_BOOL" in "boost/rational.hpp," but what happens if
> someone corrects it in "explicit_operator_bool.hpp"? Will the (temporary)
> double definition cause an error?

Well, since there isn't a constexpr_if or something, I don't see a way to add
it to BOOST_EXPLICIT_OPERATOR_BOOL. I could add
BOOST_EXPLICIT_OPERATOR_BOOL_PP(pre, post), which would add pre() and post()
before and after the operator signature. For example:


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