{"id":15047697,"url":"https://github.com/dna-intricate/intricatepointers","last_synced_at":"2025-09-08T20:33:57.457Z","repository":{"id":249189308,"uuid":"830718194","full_name":"DnA-IntRicate/IntricatePointers","owner":"DnA-IntRicate","description":"A single-header containing smart pointer implementations in C++20 ","archived":false,"fork":false,"pushed_at":"2025-09-06T14:22:40.000Z","size":690,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-06T16:18:04.131Z","etag":null,"topics":["cpp20","memory-management","reference-counting","single-header","smart-pointers"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DnA-IntRicate.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-18T20:57:09.000Z","updated_at":"2025-09-06T14:22:44.000Z","dependencies_parsed_at":"2025-09-08T20:33:29.858Z","dependency_job_id":null,"html_url":"https://github.com/DnA-IntRicate/IntricatePointers","commit_stats":null,"previous_names":["dna-intricate/intricatepointers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DnA-IntRicate/IntricatePointers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DnA-IntRicate%2FIntricatePointers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DnA-IntRicate%2FIntricatePointers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DnA-IntRicate%2FIntricatePointers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DnA-IntRicate%2FIntricatePointers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DnA-IntRicate","download_url":"https://codeload.github.com/DnA-IntRicate/IntricatePointers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DnA-IntRicate%2FIntricatePointers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231509,"owners_count":25245601,"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-09-08T02:00:09.813Z","response_time":121,"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":["cpp20","memory-management","reference-counting","single-header","smart-pointers"],"created_at":"2024-09-24T21:03:16.363Z","updated_at":"2025-09-08T20:33:57.430Z","avatar_url":"https://github.com/DnA-IntRicate.png","language":"C++","readme":"# IntricatePointers\nA single-header file written in `C++20` implementing 3 different kinds of smart pointers. The library's API contains the following types:\n\n- **Scope**: A scoped unique pointer intended to resemble `std::unique_ptr`.\n- **Ref**: A smart pointer intended to resemble `std::shared_ptr` that implements an intrusive reference counting system.\n- **WeakRef**: A weak-referencing smart pointer intended to resemble `std::weak_ptr` and the way it relates to `std::shared_ptr`.\n- **UniquePtr**: A typedef for `std::unique_ptr`.\n- **SharedPtr**: A typedef for `std::shared_ptr`.\n- **WeakPtr**: A typedef for `std::weak_ptr`.\n\n## Basic Usage\n### [Scope](Examples/Example-Scope/main.cpp):\n``` C++\nstruct MyStruct\n{\n    MyStruct(int a, int b) : A(a), B(b) { };\n    int A;\n    int B;\n};\n\nScope\u003cMyStruct\u003e scopePtr = CreateScope\u003cMyStruct\u003e(21, -21);    // Create a Scope\nscopePtr-\u003eA; scopePtr-\u003eB;                                     // Access the object\nscopePtr = nullptr;                                           // Delete the object\n```\n### [Ref](Examples/Example-Ref/main.cpp):\n``` C++\nstruct MyStruct\n{\n    MyStruct(int a, int b) : A(a), B(b) { };\n    int A;\n    int B;\n};\n\nRef\u003cMyStruct\u003e refPtr = CreateRef\u003cMyStruct\u003e(21, -21);          // Create a ref\nrefPtr-\u003eA; refPtr-\u003eB;                                         // Access the object\nrefPtr.RefCount();                                            // Get the pointer's reference count\nauto newRef = refPtr;                                         // Increment the reference count by copy-assignment\nrefPtr = nullptr;                                             // Decrement the reference count\nnewRef = nullptr;                                             // Now the reference count is 0 and the object is deleted\n```\n### [WeakRef](Examples/Example-WeakRef/main.cpp):\n``` C++\nstruct MyStruct\n{\n    MyStruct(int a, int b) : A(a), B(b) { };\n    int A;\n    int B;\n};\n\nRef\u003cMyStruct\u003e strongRef = CreateRef\u003cMyStruct\u003e(21, -21);      // Create a ref\nWeakRef\u003cMyStruct\u003e weakRef = strongRef;                       // Create a weak ref to 'strongRef'\nweakRef.RefCount();                                          // Get the pointer's reference count\n\n// Access the weak ref by locking it.\n// This will increment the reference count while the locked ref is in scope to ensure that the resources aren't deleted\nif (Ref\u003cMyStruct\u003e lockedRef = weakRef.Lock()) \n{\n    lockedRef-\u003eA;\n    lockedRef-\u003eB;\n} // Reference count is then decremented when the locked ref falls out of scope\n\nstrongRef = nullptr;    // Decrement the reference count (this deletes the object since the reference count is now 0)\n// The weak reference would now be expired since there are no strong references to it\nweakRef = nullptr;      // Release the weak reference (this only sets the internal pointer to nullptr)\n```\n\n## License\nIntricatePointers is licensed under the Apache-2.0 License. See [LICENSE](LICENSE).\n\n```\nCopyright 2024 Adam Foflonker\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdna-intricate%2Fintricatepointers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdna-intricate%2Fintricatepointers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdna-intricate%2Fintricatepointers/lists"}