
18 Nov
2013
18 Nov
'13
6:18 a.m.
AMDG On 11/17/2013 09:55 PM, Andrey Semashev wrote:
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; };
It requires N instantiations of std::conditional, doesn't it? In that case is it actually faster than the naive recursive instantiation of or_?
No it doesn't. It requires exactly two instantiations of std::conditional for all uses of or_. In Christ, Steven Watanabe