When is a template better solution than a base class??
Answer Posted / faruk
1.when you are designing a generic class to contain or otherwise manage objects of other types.
2.when the format and behaviour of those other types are unimportant to their containment or management.
3.particularly when those other types are unknown.
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What flag means?
Difference between pointer to constant vs. Pointer constant
Will a catch statement catch a derived exception if it is looking for the base class?
Which software is used for c++ programming?
Explain all the C++ concepts using examples.
What is abstraction with real time example?
Explain the problem with overriding functions
What is a null object in c++?
What is the use of default constructor?
What are c++ templates used for?
Which programming language is best?
Will a C compiler always compile C++ code a) Yes b) No c) Only optimized compilers
What is const pointer and const reference?
What are special characters c++?
What is difference between malloc()/free() and new/delete?