Well, in this example, obviously, the solution is not to use a function or a macro, but simply type (a + b) where you need it. But, in the concatenation example I was talking about, notice that the...
Type: Posts; User: Zach L.
Well, in this example, obviously, the solution is not to use a function or a macro, but simply type (a + b) where you need it. But, in the concatenation example I was talking about, notice that the...
>> And there are no specializations in this case. <<
Concatenating two C-strings? That seems like it might be a reasonable specialization. You are also excluding user (or library) defined data types...
Why on earth would you use a macro for that?
- You can't specialize macros like you can templates.
- If you end up with a bug in your macro, it could be very hard to figure out.
- You lose...
They can be really powerful if used well (not many people do use them really well, though). Besides, the idea of template meta-programming is really cool.
This is a silly argument!
Besides, we all know COBOL is the superior language.
:D