3 May
2014
3 May
'14
6:41 p.m.
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