Boost logo

Boost :

Subject: Re: [boost] [Hana/Fit] about constexpr/noexcept on equivalent functions to std::overload
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2016-07-04 17:10:20


Vicente J. Botet Escriba <vicente.botet <at> wanadoo.fr> writes:

> Hi,
>
> On the C++ standard meating in Oulu, we decided to make the
> std::overload function constexpr and conditionaly noexcept and ensure
> that the overloaded functions shall be constexpr if the stored finctions
> are.
>
> I don't find in the reference documentation of Hana and Fit any
> reference of whether the overloaded functions preserve constexpr or not.

The usual rule that's valid across Hana is that whenever the inputs are
constexpr, the outputs are constexpr too. Hence, when you use `hana::overload`
with constexpr functions, the result will be constexpr. And if these functions
can be called in a constant expression, then so does the resulting
`hana::overload`.

Regards,
Louis


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