{"id":29873936,"url":"https://github.com/paltoudara/_double_linked_list_","last_synced_at":"2025-10-25T17:16:32.451Z","repository":{"id":305732872,"uuid":"1020991595","full_name":"Paltoudara/_DOUBLE_LINKED_LIST_","owner":"Paltoudara","description":"_DOUBLE_LINKED_LIST","archived":false,"fork":false,"pushed_at":"2025-07-25T15:14:48.000Z","size":183,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-27T13:11:29.571Z","etag":null,"topics":["container","cpp","double-linked-list","iterators","simple","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Paltoudara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-16T17:51:33.000Z","updated_at":"2025-07-26T18:40:38.000Z","dependencies_parsed_at":"2025-07-27T13:11:43.325Z","dependency_job_id":"c8e7700e-da2d-4235-aa55-bf620724136f","html_url":"https://github.com/Paltoudara/_DOUBLE_LINKED_LIST_","commit_stats":null,"previous_names":["the-mastermind1/_double_linked_list_","paltoudara/_double_linked_list_"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Paltoudara/_DOUBLE_LINKED_LIST_","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paltoudara%2F_DOUBLE_LINKED_LIST_","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paltoudara%2F_DOUBLE_LINKED_LIST_/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paltoudara%2F_DOUBLE_LINKED_LIST_/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paltoudara%2F_DOUBLE_LINKED_LIST_/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Paltoudara","download_url":"https://codeload.github.com/Paltoudara/_DOUBLE_LINKED_LIST_/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Paltoudara%2F_DOUBLE_LINKED_LIST_/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267961207,"owners_count":24172514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["container","cpp","double-linked-list","iterators","simple","stl-containers"],"created_at":"2025-07-30T23:41:25.841Z","updated_at":"2025-10-25T17:16:32.445Z","avatar_url":"https://github.com/Paltoudara.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚WELCOME TO THE DOUBLE_LINKED_LIST API 🌐:\n# 🧩 Interface:\n```markdown\n```cpp\ntemplate\u003ctypename _Ty\u003e\nclass double_linked_list final {\npublic:\n\tusing iterator = list_node_iterator\u003c1\u003e;\n\n\tusing const_iterator = list_node_iterator\u003c2\u003e;\n\n\tusing reverse_iterator = list_node_iterator\u003c3\u003e;\n\n\tusing const_reverse_iterator = list_node_iterator\u003c4\u003e;\n\n\tstatic_assert(std::is_object_v\u003c_Ty\u003e, \"The C++ Standard forbids container adaptors of non-object types \"\n\t\t\"because of [container.requirements].\");\n\n\tstatic_assert(!std::is_reference_v\u003c_Ty\u003e, \"no references allowed\");\n\n\tstatic_assert(!std::is_const_v\u003c_Ty\u003e, \"no const types are allowed\");\n\n\tstatic_assert(!std::is_volatile_v\u003c_Ty\u003e, \"no volatile types are allowed\");\n\n\tdouble_linked_list()noexcept;\n\n\tdouble_linked_list(const std::initializer_list\u003c_Ty\u003e\u0026 other);\n\n\tdouble_linked_list(const double_linked_list\u003c_Ty\u003e\u0026 other);\n\n\tdouble_linked_list(double_linked_list\u003c_Ty\u003e\u0026\u0026 other)noexcept;\n\n\tdouble_linked_list\u003c_Ty\u003e\u0026 operator =(double_linked_list\u003c_Ty\u003e\u0026\u0026 other) \u0026 noexcept;\n\n\tdouble_linked_list\u003c_Ty\u003e\u0026 operator =(const std::initializer_list\u003c_Ty\u003e\u0026 other)\u0026;\n\n\tdouble_linked_list\u003c_Ty\u003e\u0026 operator =(const double_linked_list\u003c_Ty\u003e\u0026 other)\u0026;\n\n\tbool push_back(const _Ty\u0026 data);\n\n\tbool push_back(_Ty\u0026\u0026 data);\n\n\tbool insert_after(const_iterator pos, const _Ty\u0026 data);\n\n\tbool add_unique_after(const_iterator pos, const _Ty\u0026 data);\n\n\ttemplate\u003ctypename _Pred1\u003e\n\tbool add_unique_after(const_iterator pos, const _Ty\u0026 data, _Pred1 _Pred);\n\n\tbool push_front(const _Ty\u0026 data);\n\n\ttemplate\u003cclass..._Valty\u003e\n\tbool emplace_back(_Valty\u0026\u0026..._Val);\n\n\ttemplate\u003cclass..._Valty\u003e\n\tbool emplace_front(_Valty\u0026\u0026..._Val);\n\n\tbool push_front(_Ty\u0026\u0026 data);\n\n\tvoid pop_front();\n\n\tvoid pop_back();\n\n\tvoid show()const;\n\n\tvoid reverse()noexcept;\n\n\tvoid remove(const _Ty\u0026 data);\n\n\ttemplate\u003ctypename _Pred1\u003e\n\tvoid remove_if(_Pred1 _Pred);\n\n\tvoid unique();\n\n\ttemplate\u003ctypename _Pred1\u003e\n\tvoid unique(_Pred1 _Pred);\n\n\tvoid swap(double_linked_list\u003c_Ty\u003e\u0026 other)noexcept;\n\n\tbool is_ascending()const;\n\n\ttemplate\u003ctypename Compare\u003e\n\tbool is_ascending(Compare comp)const;\n\n\tbool is_descending()const;\n\n\tvoid merge(double_linked_list\u003c_Ty\u003e\u0026 other);\n\n\tvoid merge(double_linked_list\u003c_Ty\u003e\u0026\u0026 other);\n\n\ttemplate\u003ctypename Compare\u003e\n\tvoid merge(double_linked_list\u003c_Ty\u003e\u0026 other, Compare comp);\n\n\ttemplate\u003ctypename Compare\u003e\n\tvoid merge(double_linked_list\u003c_Ty\u003e\u0026\u0026 other, Compare comp);\n\n\ttemplate\u003ctypename Compare\u003e\n\tbool is_descending(Compare comp)const;\n\n\tbool is_sorted()const;\n\n\ttemplate\u003ctypename Compare1, typename Compare2 \u003e\n\tbool is_sorted(Compare1 comp1, Compare2 comp2)const;\n\n\tbool erase_after(const_iterator pos);\n\n\t~double_linked_list()noexcept;\n\tbool empty()const noexcept;\n\n\tstd::size_t size()const noexcept ;\n\n\t_NODISCARD _Ty\u0026\u0026 back()\u0026\u0026 ;\n\n\t_NODISCARD const _Ty\u0026\u0026 back()const\u0026\u0026 ;\n\n\t_NODISCARD const _Ty\u0026 back()const\u0026 ;\n\n\t_NODISCARD _Ty\u0026 back()\u0026 ;\n\n\t_NODISCARD const _Ty\u0026 front()const\u0026 ;\n\n\t_NODISCARD _Ty\u0026 front()\u0026 ;\n\n\t_NODISCARD _Ty\u0026\u0026 front()\u0026\u0026 ;\n\n\t_NODISCARD const _Ty\u0026\u0026 front()const\u0026\u0026;\n\n\titerator begin() noexcept ;\n \n\tconst_iterator begin()const noexcept ;\n\n\titerator end() noexcept ;\n\n\tconst_iterator end()const noexcept;\n\n\tconst_iterator cbegin()const noexcept ;\n\n\tconst_iterator cend()const noexcept;\n\n\treverse_iterator rbegin()noexcept ;\n\n\tconst_reverse_iterator rbegin()const noexcept ;\n\n\treverse_iterator rend() noexcept ;\n\n\tconst_reverse_iterator rend()const noexcept ;\n\n\tconst_reverse_iterator crbegin()const noexcept ;\n\n\tconst_reverse_iterator crend()const noexcept;\n\n\tbool unsafe_insert(const_iterator pos, const _Ty\u0026 data);\n    \n\tbool unsafe_erase(const_iterator pos)noexcept ;\n\n};\n```\n# 📝NOTE THAT:\nTHIS IS THE INTERFACE OF THE DOUBLE_LINKED_LIST ,WITH THIS INTERFACE YOU CAN MANIPULATE THE LIST.IF YOU WANT MORE DETAILS ABOUT THE IMPLEMENTATION JUST SEE THE List.h and Macros.h FOR HOW THINGS ARE DONE ALSO THIS DATA STRUCTURE ACCEPTS\nONLY ELEMENTS THAT ARE NOTHROW DESTRUCTIBLE\n\n# ⚙️Member functions\n1) default constructor, this function makes the list in the default state\n\n2) constructor with initializer list,if the function fails then the list is left in the default state (strong exception guarantee) else we just copy the elements of intializer list (deep copy)\n\n3) copy constructor is exactly the same as the previous constructor this time the other is a double_linked_list argument,if the function fails then the list is left in the default state (strong exception guarantee)\n\n4) move constructor,it just steals the contents of the other list and leaves it in the default state ,if this==\u0026other then the list is left in the default state\n\n5) the destructor deallocates all the list that was allocated (if it was) and returns the list back to the default state ,if the list is empty this func doesn't do anything\n\n6) push_back funtion,this function just creates a list node and pushes it by copy or move at the end of the list,if something goes wrong this function doesn't do anything(strong exception guarantee)\n\n7) push_front, this function just creates a list node and pushes it by copy or move at the start of the list,if something goes wrong this function doesn't do anything (strong exception guarantee)\n\n8) pop_front,this function just deletes the first node of the list and updates the list ,if there exists at least one node to delete,WARNING: calling this function while the list is empty will throw an pop_from_an_empty_list exception\n\n9) pop_back,this function just deletes the last node of the list and updates the list ,if there exists at least one node to delete,WARNING: calling this function while the list is empty will throw an pop_from_an_empty_list exception\n\n10) show,this function prints the list forward and backward so we know that the list is valid forward and backward,use this funtion only if the elements that the container holds are printable\n\n11) reverse,this function just reverses the list in place,if the list is like 1 2 3 4 5 the result will be 5 4 3 2 1 the reverse proccess goes like this: 12345-\u003e21345-\u003e32145-\u003e43215-\u003e54321\n\n12) swap,this function simply swaps the contents of two double linked lists ,if this==\u0026other then nothing happens\n\n13) emplace_back,this function works pretty similar to the push_back function but this time  we craft the element in place with the arguments passed and we create the list node\n\n14) emplace_front,this fucntion works pretty similar to the push_front function but this time we craft the element in place with the arguments passed and we create the list node\n\n15) move operator,deallocs our contents and steals the other's contents, WARNING: moving into ourselves will put the list in the default state so we will lose our resources\n\n16) insert_after,this funtion takes an argument pos and a copy of a value to insert it after the pos,if the pos points to nothing then nothing happens,if the position is invalid or doesn't point to a valid node of the list  that called the method an exception will be thrown not_a_valid_position exception\n\n17) add_unique_after,has exactly the same behavior as the insert_after function,the only thing that is different is that if the element is already at the list and we can see this with the help of a comparator passed to this function,then nothing happens to the list (see implementation for more details of how this works)\n\n18) remove,this function simply removes the values of the list that compare equal to the value passed as argument,if something goes wrong this funtion might delete some of the elements in the list that compare equal to the value passed or none of them  (see implementation for more details of how this works)\n\n19) remove_if,this function works pretty similar with the remove function but this time we remove elements based on a condition passed by the user (see implementation for more details of how this works)\n\n20) unique this function simply removes the duplicates in the list if they exist using  a comparator passed to the function ,WARNING: this function considers that the list is sorted and removes the duplicates this way, otherwise we would need another way to tell if there were duplicates in the list in order to remove them (see implementation for more details of how this works) and also if the comp arg throws then the list might delete some elements or not\n\n21) is_ascending checks if the list is in ascending order using a comparator passed as argument ,if something goes wrong this function doesn't do anything (strong exception guarantee) (see implementation for more details of how this works)\n\n22) is_descending same case but this time if the list is in descending order (strong exception guarantee) (see implementation for more details of how this works)\n\n23) is_sorted only tells if the list is sorted or not ,either in ascending order or descending order using a comparator passed as argument (strong exception guarantee) (see implementation for more details of how this works)\n\n24) copy operator the copy operator just copies the contents of the other to us ,we make a deep copy ,if something goes wrong the list might change in some way ,or may return to the default state (see implementation for more details of how this works) ,in the first while if a copy goes wrong the list is left with some values or none changed if something goes wrong in the if with the push_back we delete what we managed to allocate and return to default state because copy all or copy none\n\n25) copy operator with initializer list as argument works exactly the same way as the original copy operator\n\n26) merge ,this function merges two lists if they are both in ascending order and the other argument is not empty ,also we can't merge into ourselves ,if something goes wrong the behavior is complicated (see implementation for more details of how this works) and read it very carefully ,WARNING:the comparator used to merge the list in order to compare elements must not throw!!!\n\n27) erase_after ,this function takes an iterator pos and deletes the element after this position you gave,if the position is invalid or doesn't  point to a valid node of  the list that called the method an exception will be thrown not_a_valid_position exception\n\n28) unsafe_insert,this function does the same thing as the insert_after function but the only difference is that it doesn' check (for performance reasons) if the iterator passed is invalid or doesn't point to a valid node of the list that called the method,use this func if you know exactly that the iterator you passed is valid and it shows in a node of the list that called the method be very careful ,otherwise the behavior is undefined\n\n29) unsafe_erase is the same case as erase_after and has the same concept idea as unsafe_insert,use this func with care because it doesn't make checks (this is for performance purposes)\n\n30) empty ,tells if the list is empty\n\n31) size,tells the number of elements that the list currently holds\n\n32) front ,gives the first element of the list\n\n33) back,gives the last element of the list\n\n34) begin,end is for the iterator API (see implementation for more details of how this works) but begin,cbegin is the start of the list,and end,cend is the end of the list\n\n35) rbegin,rend is for the iterator API again but rbegin is the last element of the list and rend is the end from the other way\n\n# 📝NOTE THAT:\nTO SEE HOW THE ITERATOR API WORKS AND THE LIST NODE API, GO TO SEE THE IMPLEMENTATION FOR MORE DETAILS\n# 📬IF YOU HAVE ANY ISSEUES ON THIS PLZ FEEL FREE TO SUBMIT THEM 📬\n# 👥CONTRIBUTORS:\n🎨~Paltoudara\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaltoudara%2F_double_linked_list_","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaltoudara%2F_double_linked_list_","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaltoudara%2F_double_linked_list_/lists"}