Wednesday, April 3, 2019

What's STL? Why use STL?

What's STL? Why use STL?

The Standard Template Library provides a set of well structured generic C++ components that work together in a seamless way.
–AlexanderStepanov&MengLee, The Standard Template Library
A collection of composable class and function templates.
- Helper class and function templates, operators, pair
- Container and iterator class templates
- Generic algorithms that operate over iterators
- Function objects
- Adaptors


Enables generic programming in c++
-Each generic algorithm can operate over any iterator for which the necessary operations are provided.
-Extensible can support new algorithm containers iterators
Resue
The STL hides complex tedious and error-prone details
Typesafe plug compatibility between STL component
Flexibility
Iterator decouple algorithms for containers
Unanticipated combinations easily supported
Efficiency
Templates avoid virtual function overhead
Strict attention to the time complexity of algorithms





No comments:

Post a Comment