Boost logo

Boost :

Subject: Re: [boost] [GSoC, MPL11] Community probe
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2014-05-03 14:41:52


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


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