{"id":51217635,"url":"https://github.com/eggs-cpp/keyed_set","last_synced_at":"2026-06-28T05:02:09.444Z","repository":{"id":357812279,"uuid":"1220663402","full_name":"eggs-cpp/keyed_set","owner":"eggs-cpp","description":"Eggs.KeyedSet is C++23 member-keyed ordered set","archived":false,"fork":false,"pushed_at":"2026-06-09T07:21:11.000Z","size":234,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T08:26:06.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://eggs-cpp.github.io/keyed_set/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eggs-cpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2026-04-25T06:58:44.000Z","updated_at":"2026-06-09T07:19:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eggs-cpp/keyed_set","commit_stats":null,"previous_names":["eggs-cpp/keyed_set"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eggs-cpp/keyed_set","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggs-cpp%2Fkeyed_set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggs-cpp%2Fkeyed_set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggs-cpp%2Fkeyed_set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggs-cpp%2Fkeyed_set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eggs-cpp","download_url":"https://codeload.github.com/eggs-cpp/keyed_set/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eggs-cpp%2Fkeyed_set/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34877471,"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-28T02:00:05.809Z","response_time":54,"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":[],"created_at":"2026-06-28T05:02:07.488Z","updated_at":"2026-06-28T05:02:09.434Z","avatar_url":"https://github.com/eggs-cpp.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eggs.KeyedSet\n\n**Eggs.KeyedSet** is a C++23/26 single-header ordered associative container\nthat stores unique `Value` objects indexed by a designated member field,\nsatisfying all requirements of the C++26 `AssociativeContainer` named\nrequirement ([associative.reqmts]).\n\nSee the library header at\n[`include/eggs/keyed_set.hpp`](include/eggs/keyed_set.hpp).\n\n---\n\n## Synopsis\n\n```cpp\nnamespace eggs\n{\n    template \u003c\n        typename Value,\n        auto     Key,\n        typename Compare   = std::less\u003ckey-type\u003e,\n        typename Allocator = std::allocator\u003cValue\u003e\n    \u003e\n    class keyed_set;\n}\n```\n\n`keyed_set\u003cValue, Key\u003e` behaves like a `std::set\u003cValue\u003e` but exposes\n`key_type = decltype(v.*Key)` and orders elements by that member.\nAll heterogeneous lookup operations (`find`, `count`, `contains`,\n`lower_bound`, `upper_bound`, `equal_range`, `extract`, `erase`) accept\n`key_type` directly, with no `Value` object construction required.\n\n## Example\n\n```cpp\n#include \u003ceggs/keyed_set.hpp\u003e\n\nstruct Employee { int id; std::string name; double salary; };\n\neggs::keyed_set\u003cEmployee, \u0026Employee::id\u003e roster;\n\nroster.insert({101, \"Alice\",  95'000.0});\nroster.insert({102, \"Bob\",    80'000.0});\n\n// Heterogeneous lookup by int — no Employee constructed\nif (auto it = roster.find(101); it != roster.end())\n    std::cout \u003c\u003c it-\u003ename \u003c\u003c '\\n';  // Alice\n\n// Iteration is in ascending key order\nfor (auto const\u0026 e : roster)\n    std::cout \u003c\u003c e.id \u003c\u003c ' ' \u003c\u003c e.name \u003c\u003c '\\n';\n\n// from_range constructor\nstd::vector\u003cEmployee\u003e vec{ {1, \"Carol\", 70'000.0}, {2, \"Dave\", 80'000.0} };\neggs::keyed_set\u003cEmployee, \u0026Employee::id\u003e from_vec(std::from_range, vec);\n```\n\n## Requirements\n\nThe library requires a C++23-conformant compiler and standard library.\nIt is continuously tested with:\n\n- GCC 14 and 16\n- Clang 18 and 22 (libstdc++ and libc++)\n- MSVC 2022 and 2026\n- Clang-CL 20 (Windows)\n\nThere are no external dependencies.\n\n## Building\n\nThe library is header-only. Copy `include/eggs/keyed_set.hpp` into your\nproject, or use CMake:\n\n```cmake\n# As a subdirectory\nadd_subdirectory(eggs-keyed_set)\ntarget_link_libraries(my_target PRIVATE Eggs::KeyedSet)\n\n# Or via find_package after installation\nfind_package(Eggs.KeyedSet REQUIRED)\ntarget_link_libraries(my_target PRIVATE Eggs::KeyedSet)\n```\n\n### CMake options\n\n| Option (top-level) | Option (subdirectory) | Default | Description |\n|---|---|---|---|\n| `BUILD_TESTING` | `EGGS_KEYED_SET_BUILD_TESTING` | `ON` / `OFF` | Build the test suite |\n| `BUILD_EXAMPLES` | `EGGS_KEYED_SET_BUILD_EXAMPLES` | `ON` / `OFF` | Build the examples |\n| `ENABLE_INSTALL` | `EGGS_KEYED_SET_ENABLE_INSTALL` | `ON` / `OFF` | Install the library |\n\n### Configuring and building with presets\n\nThe project ships a `CMakePresets.json` with named configurations for the\nmost common workflows. CMake 3.25 or later is required to use presets.\n\n```sh\n# List all available presets\ncmake --list-presets\n\n# Configure, build, and test (GCC, Debug)\ncmake --preset dev-gcc\ncmake --build --preset dev-gcc-debug\nctest --preset dev-gcc-debug\n\n# Other toolchain variants\ncmake --preset dev-clang         # Clang with libstdc++\ncmake --preset dev-clang-libcxx  # Clang with libc++\ncmake --preset dev-msvc          # MSVC x64\ncmake --preset dev-clang-cl      # Clang-CL x64\n```\n\nBuild trees land in `build/\u003cpreset-name\u003e/` so all presets coexist without\ninterfering.\n\n## C++26 AssociativeContainer conformance\n\n`keyed_set` satisfies every expression listed in\n[associative.reqmts.general], including:\n\n- All required nested types (`key_type`, `value_type`, `key_compare`,\n  `value_compare`, `allocator_type`, `node_type`, `insert_return_type`, …)\n- Constant bidirectional iterators (`iterator == const_iterator`)\n- All constructor forms: default, comparator, iterator-range,\n  `from_range`, initializer-list, copy, move, allocator-extended variants\n- `operator=(initializer_list)`\n- `emplace`, `emplace_hint`\n- `insert` (lvalue, rvalue, hint, iterator-range, `insert_range`, initializer-list,\n  node-handle, hint + node-handle)\n- `extract` (by iterator, by key, transparent)\n- `erase` (by key, transparent, by iterator, by range)\n- `clear`, `merge`\n- `erase_if(keyed_set\u0026, Predicate)` (free function)\n- `key_comp`, `value_comp`\n- `find`, `count`, `contains`, `lower_bound`, `upper_bound`, `equal_range`\n  — all with both exact and transparent (`K const\u0026`) overloads\n- `operator==` and `operator\u003c=\u003e` (synthesises all six relational operators)\n- Member and non-member `swap`\n\n## License\n\nDistributed under the Boost Software License, Version 1.0.\n(See accompanying file [LICENSE.txt](LICENSE.txt) or copy at\n\u003chttp://www.boost.org/LICENSE_1_0.txt\u003e)\n\nCopyright Agustin K-ballo Berge, Fusion Fenix 2026\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggs-cpp%2Fkeyed_set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feggs-cpp%2Fkeyed_set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feggs-cpp%2Fkeyed_set/lists"}