The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

C++ template question (just out of curiousity) by blowfish2007-05-06 08:53:11
  templates are a specialized form of macro, so they by Schol-R-LEA;2 2007-05-06 11:28:02
don't actually exist as functions until they are applied to a given type or class; when the templated function or class is invoked with a class or typename argument, the compiler generates the actual function/class from that template, but the actual functions from two different uses of a template are, in fact, separate functions.

C and C++ programmers, IME, generally don't see them this way, because many of them are only familiar with C preprocessor macros, which are very different (and both more limited and more powerful, in various ways); but a Lisp programmer who looks at generics - whether in C++, Ada, Java, Common Lisp, or what have you - is immediately going to think, 'macro', because they are programmable constructs which get expanded at compile time into more complex structures by manipulating the code itself before actual processing.
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)