
18 Nov
2013
18 Nov
'13
6:54 a.m.
On Mon, Nov 18, 2013 at 10:18 AM, Steven Watanabe <watanabesj@gmail.com> wrote:
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_.
You mean the compiler can optimize multiple instantiations for different T::value values to just unique ones?