Go Down

Topic: min, max, abs.. are macroses? (Read 9 times) previous topic - next topic

pYro_65

I don't see a real problem with using the macros I just wish the reference would say they are macros and also have an example of how the usage may fail so people can avoid it without having in-depth c/c++ knowledge.

The biggest drawback of these macros is the inability to use those macro names in your own code. A range class for example would benefit from members named min & max over something like LowVal and HighVal for example.

kf2qd



The biggest drawback of these macros is the inability to use those macro names in your own code. A range class for example would benefit from members named min & max over something like LowVal and HighVal for example.


That's a problem with any language except for Forth. Reserved keywords and such are an issue with any language. Only Forth allows you to redefine a WORD without damaging the code that used the old version.

Go Up