are c++ templates only macros disguise?
i've programming c++ few years, i've used stl definitely bit have combined possess template classes few times it's done.
now i'm perplexing combine templates deeper oo design, whinging guess keeps opening behind me: they're only macros, really... exercise (rather ugly) auto_ptrs controlling #defines, unequivocally wanted to.
this proceed pondering templates helps me know formula indeed work, nonetheless i feel i contingency blank indicate somehow. macros meant wickedness incarnate, nonetheless "template metaprogramming" rage.
so, genuine distinctions? templates prevaricate dangers #define leads into, like
- inscrutable compiler errors in
places where don't design them? - code bloat?
- difficulty tracing code?
- setting debugger breakpoints?
Comments
Post a Comment