J
JohnQ
Gavin Deane said:JohnQ: Can templates be implemented the same way as macros - straight
text substitution?
Yes, unless you want the C++ perversions of the concept. If so, then no.
Smells like C++ lock-in to me.
Others: No - here are some examples of things you can do with
templates that you can't do with macros.
JohnQ: Oh no - I don't mean things that complex or specialised. What I
meant to ask was, "Can a limited subset of template capabilities be
implemented as straight text substitution? The subset is limited to
only those things that can be implemented as straight text
substitution."
That's my definition of templates: a typing saver, patterned
text-replacement. Anything else is a C++-ism (extension of the original
concept). You're assuming the C++ definition is the gold cow standard of all
template definition. That's in-the-box-thinking (paradigmic).
To which the answer is obviously "yes", by definition. But it's a
somewhat pointless question, is it not?
John