News for hackers. Stuff that matters.
Re:A brief guide to C++ template metaprogramming by shin_lao on Sunday September 25, 2016 @10:08AM (#12575366)
I am absolutely unconvinced by the added value of wrapping the C functions. Using TMP would be useful to adapt the C functions to a different interface, but from my understanding all it does is catching the error.

Additionally, the author implements count in the worst way possible, it's highly inefficient and it will result in very long compilation time. You don't need to do tail recursion, you can just write:

template <class... T> using count = std::integral_constant<std::size_t, sizeof...(T)>;

Such errors make me uncomfortable as it seems the author isn't up to date on the topic. A+ for intent though.

Re:A brief guide to C++ template metaprogramming by TickleSteve on Sunday September 25, 2016 @11:15AM (#12575672)
agree... the example is terrible, attempting to wrap c functions like this gives you nothing but added complexity.