{"id":25943961,"url":"https://github.com/dxrzc/list-data-structure-cpp","last_synced_at":"2026-06-12T09:31:17.201Z","repository":{"id":262559203,"uuid":"882011874","full_name":"dxrzc/list-data-structure-cpp","owner":"dxrzc","description":"Templated circular doubly linked list implementation in modern C++ focusing on low-level design, iterator support and move semantics.","archived":false,"fork":false,"pushed_at":"2026-02-14T20:29:17.000Z","size":3879,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-15T03:41:11.655Z","etag":null,"topics":["cmake","cpp20","data-structures","googletest"],"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/dxrzc.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-01T17:35:05.000Z","updated_at":"2026-02-14T20:29:20.000Z","dependencies_parsed_at":"2024-11-13T04:28:10.393Z","dependency_job_id":"76ec3d83-0bd8-418d-bd92-213a38292924","html_url":"https://github.com/dxrzc/list-data-structure-cpp","commit_stats":null,"previous_names":["itsdrc/list-data-structure-cpp","dxrzc/list-data-structure-cpp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dxrzc/list-data-structure-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrzc%2Flist-data-structure-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrzc%2Flist-data-structure-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrzc%2Flist-data-structure-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrzc%2Flist-data-structure-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dxrzc","download_url":"https://codeload.github.com/dxrzc/list-data-structure-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dxrzc%2Flist-data-structure-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34238712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"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":["cmake","cpp20","data-structures","googletest"],"created_at":"2025-03-04T07:20:26.601Z","updated_at":"2026-06-12T09:31:17.187Z","avatar_url":"https://github.com/dxrzc.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# List Data Structure (C++20)\n\nThis repository provides a templated circular doubly linked list implemented in modern C++ (C++20), focusing on iterator support, move semantics, and correctness.\n\n![Image](https://github.com/user-attachments/assets/3ed9d27e-dde9-4359-acdd-2de750db8fd1)\n\n## Features\n\n### Core design\n- Templated circular doubly linked list\n- Head node design that does not require a default-constructible type\n- Strong ownership and memory management guarantees\n\n### Iterators\n- Forward iterator\n- Const forward iterator\n- Reverse iterator\n- Const reverse iterator\n- Compatible with `std::advance`, range-based for loops, and standard algorithms\n\n### Operations\n- Copy and move semantics\n- In-place element construction (`emplace`)\n- Element access and traversal\n- Conditional removal (`remove_if`)\n- Element lookup returning iterators\n- List reversal\n- In-place sorting (QuickSort-based implementation)\n- Splicing elements between lists\n\n### Testing\n- Unit tests implemented using Google Test\n\n### Continuous integration\nLinux-based builds with compiler matrix:\n- GCC\n- Clang\n\n## Build and test\n\n### Requirements\n- C++20 compatible compiler\n- CMake\n- Ninja (recommended)\n```bash\ngit clone https://github.com/dxrzc/list-data-structure-cpp.git\ncd list-data-structure-cpp\n\ncmake -S . -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON\ncmake --build build\n\ncd build\nctest\n```\n\n## Usage\nThe following example demonstrates usage of the list with custom types, move semantics, sorting, and standard library interoperability.\n\n```cpp\n#include \"list.h\"\n#include \u003calgorithm\u003e\n#include \u003ciostream\u003e\n#include \u003citerator\u003e\n#include \u003costream\u003e\n\nclass User\n{\nprivate:\n    std::string m_username;\n    std::string m_id;\n    list\u003cstd::string\u003e m_items;\n\npublic:\n    User() = delete;\n    User(const User \u0026rhs) = default;\n    User(User \u0026\u0026rhs) = default;\n\n    User(const std::string \u0026username, const std::string \u0026id, const list\u003cstd::string\u003e \u0026items = {})\n        : m_username(username),\n          m_id(id),\n          m_items(items)\n    {}\n\n    std::size_t add_item(const std::string \u0026item_id)\n    {\n        m_items.push_back(item_id);\n        return m_items.size();\n    }\n\n    auto operator\u003c=\u003e(const User \u0026user) const\n    {\n        return m_username \u003c=\u003e user.m_username;\n    }\n\n    friend std::ostream \u0026operator\u003c\u003c(std::ostream \u0026os, const User \u0026user)\n    {\n        os \u003c\u003c \"User { name:\\\"\" \u003c\u003c user.m_username \u003c\u003c \"\\\", id:\\\"\" \u003c\u003c user.m_id \u003c\u003c \"\\\", items:[\";\n        for (std::size_t i = 0; i \u003c user.m_items.size(); ++i)\n        {\n            os \u003c\u003c \"\\\"\" \u003c\u003c user.m_items[i] \u003c\u003c \"\\\"\";\n            if (i + 1 \u003c user.m_items.size())\n                os \u003c\u003c \", \";\n        }\n        os \u003c\u003c \"]}\";\n        return os;\n    }\n};\n\nint main()\n{\n    try\n    {\n        list\u003cUser\u003e users;\n\n        // Create and copy\n        User user1{\"Lance\", \"1457\"};\n        user1.add_item(\"item1\");\n        user1.add_item(\"item2\");\n        users.push_back(user1);\n\n        // Create and \"move\"\n        User user2{\"Conor\", \"54321\"};\n        user2.add_item(\"itemA\");\n        user2.add_item(\"itemB\");\n        users.push_back(std::move(user2));\n\n        // Create in list\n        users.emplace_back(\"Ryley\", \"12345\", list\u003cstd::string\u003e{\"itemX\", \"itemY\"});\n\n        // Sort by name\n        users.sort();\n\n        // Print\n        std::ranges::copy(users, std::ostream_iterator\u003cUser\u003e(std::cout, \"\\n\"));\n    }\n    catch (const std::exception \u0026e)\n    {\n        std::cerr \u003c\u003c e.what() \u003c\u003c '\\n';\n    }\n}\n```\n\nOutput: \n```\nUser { name:\"Conor\", id:\"54321\", items:[\"itemA\", \"itemB\"]}\nUser { name:\"Lance\", id:\"1457\", items:[\"item1\", \"item2\"]}\nUser { name:\"Ryley\", id:\"12345\", items:[\"itemX\", \"itemY\"]}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxrzc%2Flist-data-structure-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdxrzc%2Flist-data-structure-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdxrzc%2Flist-data-structure-cpp/lists"}