Skip to main content
gamedev.net
🔒 Locked

template's

Started by Nullio 0 replies 150+ views
Original Post
Nullio
Nullio
What the heck is a template?? is this a new .net thing or has it been around for a while, I'll give you some code to help clarify what i mean
  
template <class type>
struct polygon
{
.
.
.
.
.
}
  
what does that template keyword do?? [edited by - Nullio on January 9, 2003 11:50:00 PM]
eldee
eldee
a template is not a .net thing..
basically, it helps with abstraction in your applications.
for example, you could have 10 overloaded functions that do the same thing:
multiply(int one, int two);
multiply(float one, float two);
multiply(double one, double two);
multiply(long one, long two); // heheh.. long one. couldnt resist
ect...

or you could have one template that takes care of all of it.
less code.. less mess. less headaches (hopefully).

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.