title: Are C++ Templates just Macros in disguise?
body: <p>I've been programming in C++ for a few years, and I've used STL quite a bit and have created my own template classes a few times to see how it's done.</p>
  
  <p>Now I'm trying to integrate templates deeper into my OO design, and a nagging thought keeps coming back to me: They're just a macros, really... You could implement (rather UGLY) auto_ptrs using #defines, if you really wanted to.</p>
  
  <p>This way of thinking about templates helps me understand how my code will actually work, but I feel that I must be missing the point somehow. Macros are meant evil incarnate, yet "template metaprogramming" is all the rage.</p>
  
  <p>So, what ARE the real distinctions? and how can templates avoid the dangers that #define leads you into, like</p>
  
  <ul>
  <li>Inscrutable compiler errors in
  places where you don't expect them?</li>
  <li>Code bloat? </li>
  <li>Difficulty in tracing code?</li>
  <li>Setting Debugger Breakpoints?</li>
  </ul>