20 May
2014
20 May
'14
2:05 a.m.
Minor addition to my previous post: By converting a type to a value by way of the type<> variable template, you can mix types and values interchangeably. That second example I gave could also be written as static_assert(count(odd{}, list(1_udl, 2_udl, 3_udl)) == 2, "Incorrect count of odd numbers."); and everything would work as expected. It is these types of interfaces that allow seamless transitions between compile-time and run-time computations.