Implementation C++ STL containers
This is a project to re-implement some C++ STL Containers to understand them.
Some requirements for this project are as follow:
Re-implement (The documents below are written in Korean.)
std::vectorstd::mapstd::stackstd::iterators_traitsstd::reverse_iteratorstd::enable_ifstd::is_integralstd::equaland/orstd::lexicographical_comparestd::pairstd::make_pair
The
Standard Template Library (STL)is a set ofC++ template classesto provide common programming data structures and functions such aslist,stack,vector, etc [1]
STLhas four components
This project is designed to implement a few containers, functions, and iterators in the C++98.
The header algorithm defines a collection of functions especially designed to be used on ranges of elements. They act on containers and provide means for various operations for the contents of the containers. [1]
Algorithms
- Sorting
- Searching
- partition
- etc.
Containers or container classes store objects and data. There are in total 7 standard "first-class" container classes and 3 container adaptor classes and only seven header files that provide access to these containers or container adaptors. [1]
| sequence containers | container adaptors | associative containers | unordered associative containers(c++11) |
|---|---|---|---|
| implement data structures which can be accessed in a sequential manner. | provide a different interface for sequential containers. | implement sorted data structures that can be quickly searched(O(long n) complexity). | implement unordered data structures that can be quickly searched |
| vector | queue | set | unordered_set (c++11) |
| list | priority queue | multiset | unordered_multiset (c++11) |
| deque | stack | map | unordered_map (c++11) |
arrays(c++11) |
multimap | unordered_multimap (c++11) |
|
forward lists(c++11) |
Flowchart of Adaptive containers and Unordered Containers [1]
Flowchart of Sequence containers and Ordered Containers [1]
The STL includes classes that overload the function call operator. Instances of such classes are called function objects or functors. Functors allow the working of the associated function to be customized with the help of parameters to be passed. [1]
As the name suggests, iterators are used for working upon a sequence of values. They are the major feature that allow generality in STL. [1]
| index | title | author | last modified | accessed | url status |
|---|---|---|---|---|---|
| 1 | The C++ Standard Template Library (STL) | GeeksforGeeks | 19 Nov, 2021 | 15 May, 2022 | ok |

