Recently I am working on a c++ project that I am not allowed to use standard template library or any other templates.
I am kinds of confused after I did some research. What are the containers belongs to standard library while others belongs to standard template library ? Or we don't say container for standard library, do we?
Is vector a container or not? Is vector a class for standard library or it belongs to STL?
I am hoping to implement a list of some structure in standard library, can I use list or vector?
An STL container is a collection of objects of the same type (the elements). Container owns the elements. Creation and destruction is controlled by the container.
C can't have an "exact equivalent" of STL because C doesn't have templates or classes.
C++ STL (standard template library) is a software library for the C++ language that provides a collection of templates representing containers, iterators, algorithms, and function objects.
Types of STL Container in C++ In C++, there are generally 3 kinds of STL containers: Sequential Containers. Associative Containers. Unordered Associative Containers.
Nothing in the C++ Standard Library "belongs" to the STL. STL is a different library that only influenced many parts in the C++ Standard Library. From the tag wiki:
[STL] is a C++ library of generic containers, iterators, algorithms, and function objects. When C++ was standardised, large parts of the STL were adopted into the Standard Library, […]
However, many people refer to the C++ Standard Library as the Standard Template Library, which is not entirely correct. I'm guessing that if you're not allowed to use the STL, they actually mean that you're not allowed to use the C++ Standard Library. But you'd have to ask them to know what they really mean.
For more information, see What's the difference between "STL" and "C++ Standard Library"?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With