
4 May
2014
4 May
'14
6:44 a.m.
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!