{"id":48147672,"url":"https://github.com/bezlant/s21_stl_containers","last_synced_at":"2026-04-04T17:01:52.037Z","repository":{"id":62404203,"uuid":"530529558","full_name":"bezlant/s21_stl_containers","owner":"bezlant","description":"📦 C++ STL Container classes implementation. (School 42)","archived":false,"fork":false,"pushed_at":"2022-12-29T05:10:54.000Z","size":153,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2023-05-23T17:24:05.250Z","etag":null,"topics":["cmake","cpp17","gtest","library","stl-containers"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bezlant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-30T06:39:08.000Z","updated_at":"2023-02-17T06:02:21.000Z","dependencies_parsed_at":"2023-01-31T08:01:21.992Z","dependency_job_id":null,"html_url":"https://github.com/bezlant/s21_stl_containers","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/bezlant/s21_stl_containers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezlant%2Fs21_stl_containers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezlant%2Fs21_stl_containers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezlant%2Fs21_stl_containers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezlant%2Fs21_stl_containers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bezlant","download_url":"https://codeload.github.com/bezlant/s21_stl_containers/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bezlant%2Fs21_stl_containers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31407391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cpp17","gtest","library","stl-containers"],"created_at":"2026-04-04T17:01:51.817Z","updated_at":"2026-04-04T17:01:52.007Z","avatar_url":"https://github.com/bezlant.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STL Containers\n\n### Table of Contents\n\n---\n\n- [Introduction](#introduction)\n- [Goals](#goals)\n- [Build](#build)\n- [Tests](#tests)\n\n### Introduction\n\n---\n\nImplementation of C++ standard template library containers: _list, map, queue, set, stack and vector_. The library provides a full set of standard methods and attributes for element handling, container capacity checking and iteration.\n\n##### Each type of containers provides the user with the following methods:\n\n- standard constructors (default constructor, copy constructor, move constructor, constructor with initialization list)\n- methods for accessing container elements (e.g. accessing an element with the index i)\n- methods for checking if a container is full (e.g. the number of elements in the container, check if the container is empty)\n- methods for changing the container (removing and adding new elements, cleaning the container)\n- methods for dealing with the container iterator.\n\n\u003cdetails\u003e\n  \u003csummary\u003eVector\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Vector Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | definition                                                                                                           |\n| ----------------- | -------------------------------------------------------------------------------------------------------------------- |\n| `value_type`      | `T` defines the type of the element (T is template parameter)                                                        |\n| `reference`       | `T \u0026` defines the type of the reference to an element                                                                |\n| `const_reference` | `const T \u0026` defines the type of the constant reference                                                               |\n| `iterator`        | `T *` or internal class `VectorIterator\u003cT\u003e` defines the type for iterating through the container                     |\n| `const_iterator`  | `const T *` or internal class `VectorConstIterator\u003cT\u003e` defines the constant type for iterating through the container |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t)                                            |\n\n_Vector Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Functions                                                | Definition                                                                                  |\n| -------------------------------------------------------- | ------------------------------------------------------------------------------------------- |\n| `vector()`                                               | default constructor, creates an empty vector                                                |\n| `vector(size_type n)`                                    | parameterized constructor, creates the vector of size n                                     |\n| `vector(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates a vector initizialized using std::initializer_list\u003cT\u003e |\n| `vector(const vector \u0026v)`                                | copy constructor                                                                            |\n| `vector(vector \u0026\u0026v)`                                     | move constructor                                                                            |\n| `~vector()`                                              | destructor                                                                                  |\n| `operator=(vector \u0026\u0026v)`                                  | assignment operator overload for moving an object                                           |\n\n_Vector Element access_\n\nThis table contains the public methods for accessing the elements of the class:\n\n| Element access                         | Definition                                      |\n| -------------------------------------- | ----------------------------------------------- |\n| `reference at(size_type pos)`          | access a specified element with bounds checking |\n| `reference operator[](size_type pos);` | access a specified element                      |\n| `const_reference front()`              | access the first element                        |\n| `const_reference back()`               | access the last element                         |\n| `iterator data()`                      | direct access the underlying array              |\n\n_Vector Iterators_\n\nThis table contains the public methods for iterating over class elements (access to iterators):\n\n| Iterators          | Definition                           |\n| ------------------ | ------------------------------------ |\n| `iterator begin()` | returns an iterator to the beginning |\n| `iterator end()`   | returns an iterator to the end       |\n\n_Vector Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity                       | Definition                                                                                      |\n| ------------------------------ | ----------------------------------------------------------------------------------------------- |\n| `bool empty()`                 | checks whether the container is empty                                                           |\n| `size_type size()`             | returns the number of elements                                                                  |\n| `size_type max_size()`         | returns the maximum possible number of elements                                                 |\n| `void reserve(size_type size)` | allocate storage of size elements and copies current array elements to a newely allocated array |\n| `size_type capacity()`         | returns the number of elements that can be held in currently allocated storage                  |\n| `void shrink_to_fit()`         | reduces memory usage by freeing unused memory                                                   |\n\n_Vector Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                                              | Definition                                                                                 |\n| ------------------------------------------------------ | ------------------------------------------------------------------------------------------ |\n| `void clear()`                                         | clears the contents                                                                        |\n| `iterator insert(iterator pos, const_reference value)` | inserts elements into concrete pos and returns the iterator that points to the new element |\n| `void erase(iterator pos)`                             | erases an element at pos                                                                   |\n| `void push_back(const_reference value)`                | adds an element to the end                                                                 |\n| `void pop_back()`                                      | removes the last element                                                                   |\n| `void swap(vector\u0026 other)`                             | swaps the contents                                                                         |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eArray\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Array Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | definition                                                                |\n| ----------------- | ------------------------------------------------------------------------- |\n| `value_type`      | `T` defines the type of an element (T is template parameter)              |\n| `reference`       | `T \u0026` defines the type of the reference to an element                     |\n| `const_reference` | `const T \u0026` defines the type of the constant reference                    |\n| `iterator`        | `T *` defines the type for iterating through the container                |\n| `const_iterator`  | `const T *` defines the constant type for iterating through the container |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t) |\n\n_Array Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Functions                                               | Definition                                                                               |\n| ------------------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| `array()`                                               | default constructor, creates an empty array                                              |\n| `array(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates array initizialized using std::initializer_list\u003cT\u003e |\n| `array(const array \u0026a)`                                 | copy constructor                                                                         |\n| `array(array \u0026\u0026a)`                                      | move constructor                                                                         |\n| `~array()`                                              | destructor                                                                               |\n| `operator=(array \u0026\u0026a)`                                  | assignment operator overload for moving an object                                        |\n\n_Array Element access_\n\nThis table contains the public methods for accessing the elements of the class:\n\n| Element access                        | Definition                                      |\n| ------------------------------------- | ----------------------------------------------- |\n| `reference at(size_type pos)`         | access a specified element with bounds checking |\n| `reference operator[](size_type pos)` | access a specified element                      |\n| `const_reference front()`             | access the first element                        |\n| `const_reference back()`              | access the last element                         |\n| `iterator data()`                     | direct access to the underlying array           |\n\n_Array Iterators_\n\nThis table contains the public methods for iterating over class elements (access to iterators):\n\n| Iterators          | Definition                           |\n| ------------------ | ------------------------------------ |\n| `iterator begin()` | returns an iterator to the beginning |\n| `iterator end()`   | returns an iterator to the end       |\n\n_Array Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity               | Definition                                      |\n| ---------------------- | ----------------------------------------------- |\n| `bool empty()`         | checks whether the container is empty           |\n| `size_type size()`     | returns the number of elements                  |\n| `size_type max_size()` | returns the maximum possible number of elements |\n\n_Array Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                           | Definition                                                |\n| ----------------------------------- | --------------------------------------------------------- |\n| `void swap(array\u0026 other)`           | swaps the contents                                        |\n| `void fill(const_reference value);` | assigns the given value to all elements in the container. |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eList\u003c/summary\u003e\n\u003cbr /\u003e\n\n_List Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | definition                                                                                          |\n| ----------------- | --------------------------------------------------------------------------------------------------- |\n| `value_type`      | `T` defines the type of an element (T is a template parameter)                                      |\n| `reference`       | `T \u0026` defines the type of the reference to an element                                               |\n| `const_reference` | `const T \u0026` defines the type of the constant reference                                              |\n| `iterator`        | internal class `ListIterator\u003cT\u003e` defines the type for iterating through the container               |\n| `const_iterator`  | internal class `ListConstIterator\u003cT\u003e` defines the constant type for iterating through the container |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t)                           |\n\n_List Functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Functions                                              | Definition                                                                                |\n| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- |\n| `list()`                                               | default constructor, creates an empty list                                                |\n| `list(size_type n)`                                    | parameterized constructor, creates the list of size n                                     |\n| `list(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates a list initizialized using std::initializer_list\u003cT\u003e |\n| `list(const list \u0026l)`                                  | copy constructor                                                                          |\n| `list(list \u0026\u0026l)`                                       | move constructor                                                                          |\n| `~list()`                                              | destructor                                                                                |\n| `operator=(list \u0026\u0026l)`                                  | assignment operator overload for moving an object                                         |\n\n_List Element access_\n\nThis table contains the public methods for accessing the elements of the class:\n\n| Element access            | Definition               |\n| ------------------------- | ------------------------ |\n| `const_reference front()` | access the first element |\n| `const_reference back()`  | access the last element  |\n\n_List Iterators_\n\nThis table contains the public methods for iterating over class elements (access to iterators):\n\n| Iterators          | Definition                           |\n| ------------------ | ------------------------------------ |\n| `iterator begin()` | returns an iterator to the beginning |\n| `iterator end()`   | returns an iterator to the end       |\n\n_List Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity               | Definition                                      |\n| ---------------------- | ----------------------------------------------- |\n| `bool empty()`         | checks whether the container is empty           |\n| `size_type size()`     | returns the number of elements                  |\n| `size_type max_size()` | returns the maximum possible number of elements |\n\n_List Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                                              | Definition                                                                                 |\n| ------------------------------------------------------ | ------------------------------------------------------------------------------------------ |\n| `void clear()`                                         | clears the contents                                                                        |\n| `iterator insert(iterator pos, const_reference value)` | inserts elements into concrete pos and returns the iterator that points to the new element |\n| `void erase(iterator pos)`                             | erases an element at pos                                                                   |\n| `void push_back(const_reference value)`                | adds an element to the end                                                                 |\n| `void pop_back()`                                      | removes the last element                                                                   |\n| `void push_front(const_reference value)`               | adds an element to the head                                                                |\n| `void pop_front()`                                     | removes the first element                                                                  |\n| `void swap(list\u0026 other)`                               | swaps the contents                                                                         |\n| `void merge(list\u0026 other)`                              | merges two sorted lists                                                                    |\n| `void splice(const_iterator pos, list\u0026 other)`         | transfers elements from list other starting from pos                                       |\n| `void reverse()`                                       | reverses the order of the elements                                                         |\n| `void unique()`                                        | removes consecutive duplicate elements                                                     |\n| `void sort()`                                          | sorts the elements                                                                         |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eMap\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Map Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | Definition                                                                                                                                                                         |\n| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `key_type`        | `Key` the first template parameter (Key)                                                                                                                                           |\n| `mapped_type`     | `T` the second template parameter (T)                                                                                                                                              |\n| `value_type`      | `std::pair\u003cconst key_type,mapped_type\u003e` Key-value pair                                                                                                                             |\n| `reference`       | `value_type \u0026` defines the type of the reference to an element                                                                                                                     |\n| `const_reference` | `const value_type \u0026` defines the type of the constant reference                                                                                                                    |\n| `iterator`        | internal class `MapIterator\u003cK, T\u003e` or `BinaryTree::iterator` as internal iterator of tree subclass; defines the type for iterating through the container                           |\n| `const_iterator`  | internal class `MapConstIterator\u003cK, T\u003e` or `BinaryTree::const_iterator` as internal const iterator of tree subclass; defines the constant type for iterating through the container |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t)                                                                                                          |\n\n_Map Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Member functions                                      | Definition                                                                                 |\n| ----------------------------------------------------- | ------------------------------------------------------------------------------------------ |\n| `map()`                                               | default constructor, creates an empty map                                                  |\n| `map(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates the map initizialized using std::initializer_list\u003cT\u003e |\n| `map(const map \u0026m)`                                   | copy constructor                                                                           |\n| `map(map \u0026\u0026m)`                                        | move constructor                                                                           |\n| `~map()`                                              | destructor                                                                                 |\n| `operator=(map \u0026\u0026m)`                                  | assignment operator overload for moving an object                                          |\n\n_Map Element access_\n\nThis table contains the public methods for accessing the elements of the class:\n\n| Element access                  | Definition                                      |\n| ------------------------------- | ----------------------------------------------- |\n| `T\u0026 at(const Key\u0026 key)`         | access a specified element with bounds checking |\n| `T\u0026 operator[](const Key\u0026 key)` | access or insert specified element              |\n\n_Map Iterators_\n\nThis table contains the public methods for iterating over class elements (access to iterators):\n\n| Iterators          | Definition                           |\n| ------------------ | ------------------------------------ |\n| `iterator begin()` | returns an iterator to the beginning |\n| `iterator end()`   | returns an iterator to the end       |\n\n_Map Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity               | Definition                                      |\n| ---------------------- | ----------------------------------------------- |\n| `bool empty()`         | checks whether the container is empty           |\n| `size_type size()`     | returns the number of elements                  |\n| `size_type max_size()` | returns the maximum possible number of elements |\n\n_Map Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                                                                   | Definition                                                                                                                                 |\n| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| `void clear()`                                                              | clears the contents                                                                                                                        |\n| `std::pair\u003citerator, bool\u003e insert(const value_type\u0026 value)`                 | inserts a node and returns an iterator to where the element is in the container and bool denoting whether the insertion took place         |\n| `std::pair\u003citerator, bool\u003e insert(const Key\u0026 key, const T\u0026 obj)`            | inserts a value by key and returns an iterator to where the element is in the container and bool denoting whether the insertion took place |\n| `std::pair\u003citerator, bool\u003e insert_or_assign(const Key\u0026 key, const T\u0026 obj);` | inserts an element or assigns to the current element if the key already exists                                                             |\n| `void erase(iterator pos)`                                                  | erases an element at pos                                                                                                                   |\n| `void swap(map\u0026 other)`                                                     | swaps the contents                                                                                                                         |\n| `void merge(map\u0026 other);`                                                   | splices nodes from another container                                                                                                       |\n\n_Map Lookup_\n\nThis table contains the public methods for viewing the container:\n\n| Lookup                          | Definition                                                                |\n| ------------------------------- | ------------------------------------------------------------------------- |\n| `bool contains(const Key\u0026 key)` | checks if there is an element with key equivalent to key in the container |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eQueue\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Queue Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | Definition                                                                |\n| ----------------- | ------------------------------------------------------------------------- |\n| `value_type`      | `T` the template parameter T                                              |\n| `reference`       | `T \u0026` defines the type of the reference to an element                     |\n| `const_reference` | `const T \u0026` defines the type of the constant reference                    |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t) |\n\n_Queue Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Functions                                               | Definition                                                                               |\n| ------------------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| `queue()`                                               | default constructor, creates an empty queue                                              |\n| `queue(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates queue initizialized using std::initializer_list\u003cT\u003e |\n| `queue(const queue \u0026q)`                                 | copy constructor                                                                         |\n| `queue(queue \u0026\u0026q)`                                      | move constructor                                                                         |\n| `~queue()`                                              | destructor                                                                               |\n| `operator=(queue \u0026\u0026q)`                                  | assignment operator overload for moving an object                                        |\n\n_Queue Element access_\n\nThis table contains the public methods for accessing the elements of the class:\n\n| Element access            | Definition               |\n| ------------------------- | ------------------------ |\n| `const_reference front()` | access the first element |\n| `const_reference back()`  | access the last element  |\n\n_Queue Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity           | Definition                            |\n| ------------------ | ------------------------------------- |\n| `bool empty()`     | checks whether the container is empty |\n| `size_type size()` | returns the number of elements        |\n\n_Queue Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                          | Definition                    |\n| ---------------------------------- | ----------------------------- |\n| `void push(const_reference value)` | inserts an element at the end |\n| `void pop()`                       | removes the first element     |\n| `void swap(queue\u0026 other)`          | swaps the contents            |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eSet\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Set Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | Definition                                                                                                                                                                          |\n| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `key_type`        | `Key` the first template parameter (Key)                                                                                                                                            |\n| `value_type`      | `Key` value type (the value itself is a key)                                                                                                                                        |\n| `reference`       | `value_type \u0026` defines the type of the reference to an element                                                                                                                      |\n| `const_reference` | `const value_type \u0026` defines the type of the constant reference                                                                                                                     |\n| `iterator`        | internal class `SetIterator\u003cT\u003e` or `BinaryTree::iterator` as the internal iterator of tree subclass; defines the type for iterating through the container                           |\n| `const_iterator`  | internal class `SetConstIterator\u003cT\u003e` or `BinaryTree::const_iterator` as the internal const iterator of tree subclass; defines the constant type for iterating through the container |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t)                                                                                                           |\n\n_Set Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Member functions                                      | Definition                                                                                 |\n| ----------------------------------------------------- | ------------------------------------------------------------------------------------------ |\n| `set()`                                               | default constructor, creates an empty set                                                  |\n| `set(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates the set initizialized using std::initializer_list\u003cT\u003e |\n| `set(const set \u0026s)`                                   | copy constructor                                                                           |\n| `set(set \u0026\u0026s)`                                        | move constructor                                                                           |\n| `~set()`                                              | destructor                                                                                 |\n| `operator=(set \u0026\u0026s)`                                  | assignment operator overload for moving an object                                          |\n\n_Set Iterators_\n\nThis table contains the public methods for iterating over class elements (access to iterators):\n\n| Iterators          | Definition                           |\n| ------------------ | ------------------------------------ |\n| `iterator begin()` | returns an iterator to the beginning |\n| `iterator end()`   | returns an iterator to the end       |\n\n_Set Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity               | Definition                                      |\n| ---------------------- | ----------------------------------------------- |\n| `bool empty()`         | checks whether the container is empty           |\n| `size_type size()`     | returns the number of elements                  |\n| `size_type max_size()` | returns the maximum possible number of elements |\n\n_Set Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                                                   | Definition                                                                                                                         |\n| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| `void clear()`                                              | clears the contents                                                                                                                |\n| `std::pair\u003citerator, bool\u003e insert(const value_type\u0026 value)` | inserts a node and returns an iterator to where the element is in the container and bool denoting whether the insertion took place |\n| `void erase(iterator pos)`                                  | erases an element at pos                                                                                                           |\n| `void swap(set\u0026 other)`                                     | swaps the contents                                                                                                                 |\n| `void merge(set\u0026 other);`                                   | splices nodes from another container                                                                                               |\n\n_Set Lookup_\n\nThis table contains the public methods for viewing the container:\n\n| Lookup                          | Definition                                                      |\n| ------------------------------- | --------------------------------------------------------------- |\n| `iterator find(const Key\u0026 key)` | finds an element with a specific key                            |\n| `bool contains(const Key\u0026 key)` | checks if the container contains an element with a specific key |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eStack\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Stack Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | Definition                                                                |\n| ----------------- | ------------------------------------------------------------------------- |\n| `value_type`      | `T` the template parameter T                                              |\n| `reference`       | `T \u0026` defines the type of the reference to an element                     |\n| `const_reference` | `const T \u0026` defines the type of the constant reference                    |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t) |\n\n_Stack Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Functions                                               | Definition                                                                               |\n| ------------------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| `stack()`                                               | default constructor, creates an empty stack                                              |\n| `stack(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates stack initizialized using std::initializer_list\u003cT\u003e |\n| `stack(const stack \u0026s)`                                 | copy constructor                                                                         |\n| `stack(stack \u0026\u0026s)`                                      | move constructor                                                                         |\n| `~stack()`                                              | destructor                                                                               |\n| `operator=(stack \u0026\u0026s)`                                  | assignment operator overload for moving an object                                        |\n\n_Stack Element access_\n\nThis table contains the public methods for accessing the elements of the class:\n\n| Element access          | Definition               |\n| ----------------------- | ------------------------ |\n| `const_reference top()` | accesses the top element |\n\n_Stack Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity           | Definition                            |\n| ------------------ | ------------------------------------- |\n| `bool empty()`     | checks whether the container is empty |\n| `size_type size()` | returns the number of elements        |\n\n_Stack Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                          | Definition                    |\n| ---------------------------------- | ----------------------------- |\n| `void push(const_reference value)` | inserts an element at the top |\n| `void pop()`                       | removes the top element       |\n| `void swap(stack\u0026 other)`          | swaps the contents            |\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eMultiset\u003c/summary\u003e\n\u003cbr /\u003e\n\n_Multiset Member type_\n\nThis table contains in-class type overrides (typical for the standard STL library) that are adopted to make class code easy to understand:\n\n| Member type       | Definition                                                                                                                                                                           |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `key_type`        | `Key` the first template parameter (Key)                                                                                                                                             |\n| `value_type`      | `Key` value type (the value itself is a key)                                                                                                                                         |\n| `reference`       | `value_type \u0026` defines the type of the reference to an element                                                                                                                       |\n| `const_reference` | `const value_type \u0026` defines the type of the constant reference                                                                                                                      |\n| `iterator`        | internal class `MultisetIterator\u003cT\u003e` or `BinaryTree::iterator` as internal iterator of tree subclass; defines the type for iterating through the container                           |\n| `const_iterator`  | internal class `MultisetConstIterator\u003cT\u003e` or `BinaryTree::const_iterator` as internal const iterator of tree subclass; defines the constant type for iterating through the container |\n| `size_type`       | `size_t` defines the type of the container size (standard type is size_t)                                                                                                            |\n\n_Multiset Member functions_\n\nThis table contains the main public methods for interacting with the class:\n\n| Member functions                                           | Definition                                                                                 |\n| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------ |\n| `multiset()`                                               | default constructor, creates an empty set                                                  |\n| `multiset(std::initializer_list\u003cvalue_type\u003e const \u0026items)` | initializer list constructor, creates the set initizialized using std::initializer_list\u003cT\u003e |\n| `multiset(const multiset \u0026ms)`                             | copy constructor                                                                           |\n| `multiset(multiset \u0026\u0026ms)`                                  | move constructor                                                                           |\n| `~multiset()`                                              | destructor                                                                                 |\n| `operator=(multiset \u0026\u0026ms)`                                 | assignment operator overload for moving an object                                          |\n\n_Multiset Iterators_\n\nThis table contains the public methods for iterating over class elements (access to iterators):\n\n| Iterators          | Definition                           |\n| ------------------ | ------------------------------------ |\n| `iterator begin()` | returns an iterator to the beginning |\n| `iterator end()`   | returns an iterator to the end       |\n\n_Multiset Capacity_\n\nThis table contains the public methods for accessing the container capacity information:\n\n| Capacity               | Definition                                      |\n| ---------------------- | ----------------------------------------------- |\n| `bool empty()`         | checks whether the container is empty           |\n| `size_type size()`     | returns the number of elements                  |\n| `size_type max_size()` | returns the maximum possible number of elements |\n\n_Multiset Modifiers_\n\nThis table contains the public methods for modifying a container:\n\n| Modifiers                                  | Definition                                                                      |\n| ------------------------------------------ | ------------------------------------------------------------------------------- |\n| `void clear()`                             | clears the contents                                                             |\n| `iterator insert(const value_type\u0026 value)` | inserts a node and returns an iterator to where the element is in the container |\n| `void erase(iterator pos)`                 | erases an element at pos                                                        |\n| `void swap(multiset\u0026 other)`               | swaps the contents                                                              |\n| `void merge(multiset\u0026 other)`              | splices nodes from another container                                            |\n\n_Multiset Lookup_\n\nThis table contains the public methods for viewing the container:\n\n| Lookup                                                     | Definition                                                           |\n| ---------------------------------------------------------- | -------------------------------------------------------------------- |\n| `size_type count(const Key\u0026 key)`                          | returns the number of elements matching a specific key               |\n| `iterator find(const Key\u0026 key)`                            | finds element with a specific key                                    |\n| `bool contains(const Key\u0026 key)`                            | checks if the container contains element with a specific key         |\n| `std::pair\u003citerator,iterator\u003e equal_range(const Key\u0026 key)` | returns range of elements matching a specific key                    |\n| `iterator lower_bound(const Key\u0026 key)`                     | returns an iterator to the first element not less than the given key |\n| `iterator upper_bound(const Key\u0026 key)`                     | returns an iterator to the first element greater than the given key  |\n\n\u003c/details\u003e\n\n### Goals\n\n---\n\n- [x] Outline the project structure\n- [x] Integrate CMake\n- [x] Integrate Gtest\n- [x] Array class\n- [x] Vector class\n- [x] List class\n- [x] Queue class\n- [x] Stack class\n- [x] Map class\n- [x] Set class\n- [x] Multiset class\n\n### Build\n\n---\n\n```\n$ git clone https://github.com/bezlant/s21_stl_containers\n$ cd s21_stl_containers\n$ mkdir build \u0026\u0026 cd build\n$ cmake ..\n$ make\n```\n\n### Tests\n\n---\n\nUnit tests are implemented using [googletest](https://google.github.io/googletest/) \u0026 coverage report with [llvm-cov](https://llvm.org/docs/CommandGuide/llvm-cov.html)\n\n### Credits\n\n---\n\nA huge amount of work was done by [Dmitriy (@hubertfu)](https://github.com/HubertFurr).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezlant%2Fs21_stl_containers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbezlant%2Fs21_stl_containers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbezlant%2Fs21_stl_containers/lists"}