When is a template a better solution than a base class, C/C++ Programming

When you are designing a generic class to have or otherwise manage objects of other types, when the format and behavior of those other types are unimportant to their containment or management, and particularly when those other types are unknown (therefore, the genericity) to the designer of the container or manager class.            

 

 

Posted Date: 4/9/2013 12:58:35 AM | Location : United States







Related Discussions:- When is a template a better solution than a base class, Assignment Help, Ask Question on When is a template a better solution than a base class, Get Answer, Expert's Help, When is a template a better solution than a base class Discussions

Write discussion on When is a template a better solution than a base class
Your posts are moderated
Related Questions
Explain about the Variables in c language? The Variable is an identifier that is used to represent some specified kind of information within a designated portion of the program

Templates permit to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until

write a C code that plots an object on the window and on the user''s click of mouse on the window, the object starts rotating continuously until the user presses the mouse again

Q: however shouldn't I always use a printOn() method instead of a friend function? A: No. The usual cause people wish to always use a printOn() method instead of  a friend fu

Write algorithms to implement the insertion and deletion operations.

how much is it to fix a small data struct in a sorted list that pass itemtypes. all the code is written just logical errors

Ques.Implement a c/c++ program to find a shortest path between two nodes in a network?network should be taken as an adjacency matrix.

A: C++, unlike only about every other language with exceptions, is extremely accomodating while it comes to what you can throw. Actually, you can throw anything you akin to. That b

what are assessor. elaborate with clear easy diagrams

Write a algorithm to explain the processof wakingbup in morning