Two weeks ago I wrote how happy I was finding out the C++ 14 has gotten around to support binary literals. However, If you are stuck with a slightly older compiler (like Visual Studio 2013) binary literal can also be easily expressed in C++ 11!
In his excellent post, Paul Preney outlines a tiny framework that will allow writing expressions of the type:
It is done by user defined literals processed in by variadic template functions in a pattern similar to the one outlined in C++ Variadic templates from the ground up.
Roll all the way down to the end of the post for the complete 50 lines listing (including a small demo program)