{"id":22309512,"url":"https://github.com/joeloser/enum-flag-set","last_synced_at":"2025-03-26T01:43:57.298Z","repository":{"id":84796340,"uuid":"118288838","full_name":"JoeLoser/enum-flag-set","owner":"JoeLoser","description":"Header-only library providing bit flags for enum classes.","archived":false,"fork":false,"pushed_at":"2018-04-02T22:02:10.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T23:17:49.405Z","etag":null,"topics":["bitflags","bitmask"],"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/JoeLoser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"contributing/commit_template","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":"2018-01-20T23:21:00.000Z","updated_at":"2021-02-11T16:15:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"f65e7052-d51a-4607-bb94-e9ba68cfc7dd","html_url":"https://github.com/JoeLoser/enum-flag-set","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeLoser%2Fenum-flag-set","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeLoser%2Fenum-flag-set/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeLoser%2Fenum-flag-set/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeLoser%2Fenum-flag-set/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoeLoser","download_url":"https://codeload.github.com/JoeLoser/enum-flag-set/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245573841,"owners_count":20637670,"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","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":["bitflags","bitmask"],"created_at":"2024-12-03T20:43:11.679Z","updated_at":"2025-03-26T01:43:57.278Z","avatar_url":"https://github.com/JoeLoser.png","language":"C++","readme":"# Bit Flags for enum classes\n\n## Synopsis\n\nThis header-only library introduces a `flag_set` class template which provides bit\nflags for enum classes.\n\n## Motivation\n\nWhile enum classes are great in that they are strongly typed and do not implicitly\ncast to the underlying type, we cannot use the bitwise operators directly out\nof the box because of this. So, we would like to define bitwise operators on some\ntype and have our type safety still.\n\nThe `flag_set\u003cEnumType\u003e` class template introduces this exact strong type and defines\nbitwise operators on the underlying values the container holds.\n\n## Code Example\n[Try it out on Wandbox](https://wandbox.org/permlink/KzED2WMlJBYPQybg)\n\n```c++\n#include \u003cutility\u003e\n\n#include \"flag_set.hpp\"\n\nenum class ExampleEnumClass\n{\n    One = 1,\n    Two = 1 \u003c\u003c 1\n};\nUSE_FLAGS_FOR_ENUM(ExampleEnumClass);\n\nint main()\n{\n    constexpr auto mask = ExampleEnumClass::One | ExampleEnumClass::Two;\n    if constexpr(mask)\n    {\n        // Do something :)\n    }\n\n    return EXIT_SUCCESS;\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeloser%2Fenum-flag-set","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeloser%2Fenum-flag-set","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeloser%2Fenum-flag-set/lists"}