DEV Community

Cover image for The Standard Template Library (STL)
Saloni Goyal
Saloni Goyal

Posted on • Updated on

The Standard Template Library (STL)

Some languages provide keywords to perform specific tasks like print, eval, call, etc.

C++ used functions and classes for just about everything and tries not to add keywords as much as possible.

You can create a pile of functions or a pile of classes or a pile of both and then distribute it as a library for others to use.

  • Libraries can be linked into your application along with the object files, or
  • included into your code to be compiled

Every compiler that meets the ISO standard, includes a library called The Standard Library, popularly known as STL.

It allows you to build an application by using code that other people have already written.

Misconceptions About STL


  • When I started learning C++ and even before that, I used to always hear about STL and worry that it is something vast and extensive and not something that I can completely master.

Instead, it is one of the most helpful features of C++.

  • Some people also think that STL is only useful for competitive programming and that is also not the case. It is useful to anyone who wants to work with C++.

  • With libraries like STL, you can write applications in C++ even if you don't fully understand the underlying mechanisms of your code.

  • It is like learning to drive a car. You can easily learn to drive a car without knowing how the car engine works. Ofcourse to be a better driver you would want to eventually learn the workings of a car, so that you can maintain it better but simply learning to drive is good enough to start.

Please leave out comments with anything you don't understand or would like for me to improve upon.

Thanks for reading!

Top comments (2)

nemanajay profile image
Ajay Neman

STL is the heart of Every competitive coder. R u doing competitive coding ?

blender profile image
Saloni Goyal

Hi Ajay! No, I am currently more focused towards development. And yes STL is an absolute blessing for C++ developers.