I came across this problem via a colleague today. He had a design for a front end system which goes like this:
class LWindow
{
//Interface for common meth
I found that
Using the preprocessor #define directive to define constants is not as precise.
[src]
Macros are apparently not as precise, I did not even know that... The classic hidden dangers of the preprocessor like:
#define PI_PLUS_ONE (3.14 + 1)`
By doing so, you avoid the possibility that an order of operations issue will destroy the meaning of your constant:
x = PI_PLUS_ONE * 5;`
Without parentheses, the above would be converted to
x = 3.14 + 1 * 5;
[src]