{"id":19904176,"url":"https://github.com/bertptrs/safelist","last_synced_at":"2026-06-13T14:32:55.428Z","repository":{"id":68622276,"uuid":"99722550","full_name":"bertptrs/safelist","owner":"bertptrs","description":"A  memory-safe linked list in C++","archived":false,"fork":false,"pushed_at":"2017-08-24T14:23:21.000Z","size":86,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T07:26:22.855Z","etag":null,"topics":["c-plus-plus","data-structures","linked-list","memory-management"],"latest_commit_sha":null,"homepage":"https://bertptrs.nl/2017/08/26/memory-safe-linked-lists.html","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/bertptrs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-08T18:10:20.000Z","updated_at":"2021-10-13T20:26:17.000Z","dependencies_parsed_at":"2023-02-21T09:46:14.627Z","dependency_job_id":null,"html_url":"https://github.com/bertptrs/safelist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertptrs/safelist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fsafelist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fsafelist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fsafelist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fsafelist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertptrs","download_url":"https://codeload.github.com/bertptrs/safelist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertptrs%2Fsafelist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34288664,"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-13T02:00:06.617Z","response_time":62,"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":["c-plus-plus","data-structures","linked-list","memory-management"],"created_at":"2024-11-12T20:27:15.249Z","updated_at":"2026-06-13T14:32:55.402Z","avatar_url":"https://github.com/bertptrs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# safelist -- An memory-safe linked list in C++\n\n[![Build Status](https://travis-ci.org/bertptrs/safelist.svg?branch=master)](https://travis-ci.org/bertptrs/safelist)\n\nThis repository contains a header-only reimplementation of `std::list`\nusing the memory constructs introduced in C++11. The goals of this\nproject is as follows:\n\n- Have a delete-free implementation of a linked list\n- Prevent use-after-free memory errors\n- Prevent dangling pointers\n- Prevent memory leaks\n\nOther problems, such as null-pointer dereferencing are still very much\npossible and will still occur, but will be more predictable.\n\n## Usage\n\nThe `safelist` is designed as a drop-in replacement for `std::list`, so\nreplacing it should not be a problem. Include [safelist.hpp](safelist.hpp)\nwherever you would normally include `list`, and change your types\naccordingly.\n\nNot everything is implemented exactly as it is in `std::list`. Key\ndifferences are:\n\n- Allocator is not specifiable, and is the default allocator\n- Features are lacking according to what it says in\n  [Progress](#progress)\n- Not all typedefs are implemented\n- Not all undefined behaviour works the same way. For instance,\n  iterating past the end causes a loop back to the start.\n- The move variant of `merge()` is missing, because there is no real\n  benefit to it in this implementation.\n- The move variant of `splice()` is missing for the same reason.\n\n## Progress\n\n### Basic use\n\n- [x] Empty constructor\n- [x] Count constructor\n- [x] Range constructor\n- [x] Assignment operators\n- [x] Push back/push front\n- [x] Emplace back/emplace front\n- [x] Pop back/pop front\n- [x] Iterators\n- [x] Const iterators\n- [x] Reverse iterators\n- [x] Const reverse iterators\n- [x] Insert at iterator\n- [x] Emplace at iterator\n- [x] Delete at iterator\n- [x] Sizing\n- [x] Resizing\n\n### Comparisons\n\n- [x] Equality/inequality\n- [x] Greater than/less than\n\n### Algorithmic use\n\n- [x] sort\n- [x] merge\n- [x] splice\n- [x] remove (if)\n- [x] reverse\n- [x] unique\n\n## Why would you do this?\n\nI learned about C++ smart pointers but since the main things I write\ncode for are university assignments (not a lot of memory management in\ngeneral) and programming contest submissions (no need for readable,\nmaintainable code) so I never looked into it.\n\nFor the summer I wanted a programming challenge to do, so here it is.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertptrs%2Fsafelist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertptrs%2Fsafelist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertptrs%2Fsafelist/lists"}