C++ STL

The C++ STL (Standard Template Library) is a generic collection of class templates and algorithms that allow programmers to easily implement standard data structures like queues, lists, and stacks.



The C++ STL provides programmers with the following constructs, grouped into three categories:
The idea behind the C++ STL is the hard part of using complex data structures has already been completed. If a programmer would like to use a stack of integers, all that he/she has to do is use this code:
stack<int> myStack;

With minimal effort, he/she can now push() and pop() integers onto this stack. Through the magic of C++ Templates, he/she could specify any data type, not just integers. the STL Stack class will provide generic functionality of stack, regardless of the data in the stack.

In addition, the STL also provides lots of useful algorithms like searching, sorting, and general-purpose iterating algorithms that can be used on a variety of data structures.

Motivation:

  • Saves lots of time during Contest.
  • Makes the code sort and readable for fast debugging.
  • Ready-made data structures and algorithms which are rigorously tested.

Comments