I\'m using a well known template to allow binary constants
template< unsigned long long N > struct binary { enum { value = (N % 10) + 2 * binary<
C++0x has user-defined literals, which could be used to implement what you're talking about.
Otherwise, I don't know how to improve this template.