
Louis Dionne <ldionne.2 <at> gmail.com> writes:
template <typename ...T> void allow_expansion(T&&...);
template <typename ...T> struct or_ { static constexpr bool value = !noexcept( allow_expansion((T::value ? throw : 0)...) ); };
How embarrassing; my unit test was very poor and the above trick does not seem to work. However, the following was tested more rigorously and works (with similar performance improvements): template <typename ...T> constexpr bool all_pointers(T*...) { return true; } template <typename ...T> constexpr bool all_pointers(T...) { return false; } template <typename ...T> struct or_ { static constexpr bool value = !all_pointers( ((typename std::conditional<T::value, int, void*>::type)0)... ); }; template <> struct or_<> { static constexpr bool value = false; }; Regards, Louis Dionne