Tag Archives: template-metaprogramming

Compile-time binary literals [via pseudorandom noise]

This is a great post that shows off the new user-defined literals feature in C++11, using it to implement binary number literals such as 1011101010111110_binary. Paul also shows off some great template metaprogramming to achieve this end including¬†template specialization, variadic templates (with template parameter packs and template recursion), and the sizeof… operator, which I’d not previously come across.

Quite a collection of features to discuss in one post, but done clearly and cohesively.

Continue reading

Link | Posted on by | Tagged , , , , , , | Leave a comment