Boost logo

Boost :

Subject: Re: [boost] Interesting variadic template trick
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-11-19 16:38:25


On 20/11/2013 03:13, Quoth Mathias Gaunard:
>> template <typename ...T>
>> struct or_ {
>> static constexpr bool value = !noexcept(
>> allow_expansion((T::value ? throw : 0)...)
>> );
>> };
>
> An obvious problem with this is that it doesn't compile if exceptions
> are disabled.
> And I think being able to use meta-programming without exceptions is an
> important property to have.

If you look at the followup, it doesn't use noexcept any more.


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