25 Nov 2019

  • November 25, 2019
  • Amitraj
C++ Standered Template Library (STL)

Template can be used to create generic classes and functions that could extend supports for Generic programming.
    -> In order to help the C++ users in generic programming, Alexander Stepanov and Meng Lee of Hewlett packard developed a set of general purpose templatized classes (data structure) and functions (Algorithms) that could be used as a standered approach for sorting and processing data.


->The collection of these Generic classes and functions is called, the Standered template library (STL). The STL has now become a part of ANSI standered C++ class library.


-> STL components which are now part of standered C++ library are defined in the namespace std. we must use the using namespace directive.


         using namespace std;
  to inform the compiler that we intend to use the standered C++ library. All programs use this directive.

Related Posts:

  • Static Class member in Class Template Static Class member in Class Template -> Each instantiation of class template has its own copy of member static variables. For example, in the following program there are two instances collection and collection. So … Read More
  • Overloading function Templates in C++ Overloading function Templates in C++ -> We may overload a function Template either by a non - template function template. -> if we call the name of an overloaded function template, the compiler will try to deduce it… Read More
  • Templates in C++ Templates in C++ -> Templates is one of the features added to C++ Recently. it is a new concept which enable us to define Generic classes and functions and thus provides support for Generic programming. -> Generic pr… Read More
  • Why A Constructor can not be Virtual Why A Constructor can not be Virtual "A constructor can not be virtual". There are some valid reasons that justify this statement. -> First, to create an object the constructor of the object class must be of the same ty… Read More
  • Virtual Destructors in C++ Virtual Destructors in C++ A virtual destructor however, is pretty much feasible in C++. in fact, its use is often promoted in certain situations. One such situation is when we need to make sure that the different dest… Read More

Translate

Popular Posts