4 ms·
I think the most important benefit is simpler and just the code clarity for your constants. For instance if you have compile time constants for width and height
by geokon 8y ago
I think the most important benefit is simpler and just the code clarity for your constants. For instance if you have compile time constants for width and height you can sanely write diagonal=Pythagoras(width,height) and be done and know you have that value at compile time.
Before you'd either have to hope the compiler did that for you magically, do something ugly with the preprocessor, or bake in numbers
In a way all your examples are just more extreme version of the same but I guess my point is that it's not something fringe for fancy optimizations, it's daily use.