Monday, March 20, 2006

Templates.... the next level of overloading

'Templates' is one concept that i learnt today... Templates give awesome flexibility and generic nature to programs ... Its the next level to overloading.. There r two types... Class templates and function templates... A function template is more like overloading but the advantage is u dont have to declare different functions for different datatypes.. If your function logical does the same irrespective of the type of operands, then templates come in handy to save LOCs and improve readability. A class template helps u delcare a class that can vary in member elements types/arguments depending on how an object of that class is declared. Its a concept great enuf that it had a full workshop on it.
Here's more on Templates

0 Comments:

Post a Comment

<< Home