{"id":15047578,"url":"https://github.com/wolgemoth/cpp-hashset","last_synced_at":"2026-02-24T06:43:42.843Z","repository":{"id":250499748,"uuid":"834630923","full_name":"wolgemoth/cpp-hashset","owner":"wolgemoth","description":"Concurrent multiplatform hashset with simple API, exception safety, and sequential collision resolution. ","archived":false,"fork":false,"pushed_at":"2024-08-07T16:33:06.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T22:35:11.234Z","etag":null,"topics":["concurrency","concurrent","cpp","cpp17","exception-safety","hashset","initializer-list","modern-cpp","multiplatform","multithreading","sequential-chain","set","templates"],"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/wolgemoth.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":"2024-07-27T21:37:35.000Z","updated_at":"2024-08-07T16:33:09.000Z","dependencies_parsed_at":"2025-03-13T20:21:27.512Z","dependency_job_id":"1e0b195c-9c8c-4008-9b49-e46dcff4b316","html_url":"https://github.com/wolgemoth/cpp-hashset","commit_stats":null,"previous_names":["wolgemoth/cpp-hashset"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wolgemoth/cpp-hashset","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolgemoth%2Fcpp-hashset","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolgemoth%2Fcpp-hashset/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolgemoth%2Fcpp-hashset/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolgemoth%2Fcpp-hashset/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wolgemoth","download_url":"https://codeload.github.com/wolgemoth/cpp-hashset/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wolgemoth%2Fcpp-hashset/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29774447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"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":["concurrency","concurrent","cpp","cpp17","exception-safety","hashset","initializer-list","modern-cpp","multiplatform","multithreading","sequential-chain","set","templates"],"created_at":"2024-09-24T21:00:36.130Z","updated_at":"2026-02-24T06:43:42.807Z","avatar_url":"https://github.com/wolgemoth.png","language":"C++","readme":"# C++ Hashset (1.0.1)\n\n## Table of Contents\n\n- [About](#About)\n- [Instructions](#Instructions)\n- [Dependencies](#Dependencies)\n- [References](#References)\n\n### About\n\nThis is a hashset written in C++.\n\nIt has a similar API to C#'s [HashSet](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1?view=net-8.0)  and self-initializes like an [std::vector](https://en.cppreference.com/w/cpp/container/vector). Currently, it uses [sequential chaining](https://en.wikipedia.org/wiki/Hash_table#Separate_chaining) for collision resolution. More collision resolution techniques may be added in the future.\n\nThis structure provides robust exception safety, and is suitable for use in a concurrent environment. Furthermore, it supports move semantics and initialiser lists.\n\nExplicit finalization of the hashset is not necessary. However, if you are storing manually-managed memory, then remember to free any elements before removal.\n\nIf you find a bug or have a feature-request, please raise an issue.\n\nLike hashmaps? Check out my other project: [cpp-hashmap](https://github.com/wolgemoth/cpp-hashmap)!\n\n### Instructions\n\nThe implementation is header-only and written in templated C++17. You should not need to make any adjustments to your project settings or compiler flags. \n\nSimply include it in your project and you are ready to start!\n\n#### Example:\n    \n    #include \u003cstring\u003e\n    \n    #include \"Hashset.hpp\"\n    \n    LouiEriksson::Hashset\u003cstd::string\u003e hashset {\n        \"key1\",\n        \"key2\",\n        \"key3\",\n    }\n\n    int main() {\n\n        if (const auto item = hashset.Get(\"key3\")) {\n            std::cout \u003c\u003c \"Value: \" \u003c\u003c item.value() \u003c\u003c '\\n';\n        }\n        else {\n            std::cout \u003c\u003c \"Key not in Hashset!\\n\";\n        }\n\n        return 0;\n    }\n\n### Dependencies\n\nThe hashset was written in C++17 and utilises the following standard headers:\n\n#### \u0026lt;algorithm\u0026gt;\n#### \u0026lt;cstddef\u0026gt;\n#### \u0026lt;functional\u0026gt;\n#### \u0026lt;initializer_list\u0026gt;\n#### \u0026lt;iostream\u0026gt;\n#### \u0026lt;mutex\u0026gt;\n#### \u0026lt;optional\u0026gt;\n#### \u0026lt;stdexcept\u0026gt;\n#### \u0026lt;vector\u0026gt;\n\n### Why not use \u0026lt;unordered_set\u0026gt;?\n\nI find unordered_set to be way too verbose for most situations.\n\nIn this implementation, key existence and retrieval are merged into a single conditional expression. This allows for simpler, cleaner code that affords better exception handling.\n\n### Note\n\nPlease note that while the hashset is capable of being used in a concurrent environment, it does not provide a mechanism for synchronising changes to the hashset which are made in between operations.\n\nTherefore, if you need to perform a synchronous series of operations on the hashset while it is being used in a concurrent context, you should lock access to the hashset to one thread while doing so, otherwise you may encounter race conditions.\n\n### References\n\n- Wang, Q. (Harry) (2020). Implementing Your Own HashMap (Explanation + Code). YouTube. Available at: https://www.youtube.com/watch?v=_Q-eNqTOxlE [Accessed 2021].\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolgemoth%2Fcpp-hashset","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolgemoth%2Fcpp-hashset","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolgemoth%2Fcpp-hashset/lists"}