Skip to main content.

Sun, 05 Oct 2008

Analog literals

A solution to a common problem:

// Consider:
 unsigned int a = 4;
// Have you ever felt that integer literals like "4" don't convey the true size of the value they denote? If so, use an analog integer literal instead:
 unsigned int b = I---------I;
 assert( a == b );


[] permanent link