Boost logo

Boost :

Subject: Re: [boost] [GSoC, MPL11] Community probe
From: Roland Bock (rbock_at_[hidden])
Date: 2014-05-04 02:44:40


On 2014-05-03 20:41, Louis Dionne wrote:
> Roland Bock <rbock <at> eudoxos.de> writes:
>
> [...]
>
>> That got me thinking, and here's a new version. Even faster (at least on
>> my setup, see below), and very easy to read, I think:
>>
>> // ------------------------------
>> #include <type_traits>
>>
>> template<bool...>
>> struct all_helper
>> {};
>>
>> template<bool... Bs>
>> using all_t = std::is_same<all_helper<Bs...>, all_helper<(true or Bs)...>>;
>> // --------------------------------
> This is _awesome_; thank you for sharing. According to my benchmarks (see my
> reply to Augustin), that is the most efficient way of performing a non short
> circuiting logical and at compile-time on <= 1K booleans.
>
> Louis
>
You're welcome, thanks a lot for the credits!


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