{"id":13729930,"url":"https://github.com/grisumbras/enum-flags","last_synced_at":"2025-03-17T06:31:47.439Z","repository":{"id":19289774,"uuid":"22526851","full_name":"grisumbras/enum-flags","owner":"grisumbras","description":"Bit flags for C++11 scoped enums","archived":false,"fork":false,"pushed_at":"2022-08-19T10:52:46.000Z","size":2649,"stargazers_count":120,"open_issues_count":9,"forks_count":20,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-02-27T19:04:41.057Z","etag":null,"topics":["bit-flag","bit-mask","c-plus-plus","scoped-enum"],"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/grisumbras.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}},"created_at":"2014-08-01T20:21:02.000Z","updated_at":"2024-11-15T03:44:50.000Z","dependencies_parsed_at":"2022-08-04T18:30:38.241Z","dependency_job_id":null,"html_url":"https://github.com/grisumbras/enum-flags","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fenum-flags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fenum-flags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fenum-flags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grisumbras%2Fenum-flags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grisumbras","download_url":"https://codeload.github.com/grisumbras/enum-flags/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847062,"owners_count":20357317,"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":["bit-flag","bit-mask","c-plus-plus","scoped-enum"],"created_at":"2024-08-03T02:01:07.659Z","updated_at":"2025-03-17T06:31:46.897Z","avatar_url":"https://github.com/grisumbras.png","language":"C++","readme":"# enum-flags\n\n[![Download](https://api.bintray.com/packages/grisumbras/conan/enum-flags:grisumbras/images/download.svg?version=0.1.0:testing) ](https://bintray.com/grisumbras/conan/enum-flags:grisumbras/0.1.0:testing/link)\n![Build Status](https://github.com/grisumbras/enum-flags/workflows/publish/badge.svg)\n![License](https://img.shields.io/github/license/grisumbras/enum-flags.svg)\n\n\u003e Bit flags for C++ scoped enums\n\nC++ 11 added a new type of enums — *enum classes*.\nThese are strongly typed enumerations, they do not cast implicitly to or from\nthe underlying integer type. They also do not leak enumeration values to\nenclosing scope (thus the names of this values do not clash and you no longer\nneed to prefix/suffix them with something to disambiguate).\n\nThe only drawback to type safety is you cannot treat variables of *enum class*\ntypes as sets of flags. That is because *enum classes* do not cast to integers\nand there are no bitwise operators overloads defined for them.\n\nThis library brings a `flags` class template which provides bit flags for\nscoped enums.\n\n\n## Install\n\n### Using Conan\n\nAdd required remote:\n\n```shell\n$ conan remote add grisumbras https://api.bintray.com/conan/grisumbras/conan\n\n```\n\nUse inside `conanfile.txt`:\n\n```ini\n[requires]\nenum-flags/[\u003e=0.1]@grisumbras/testing\n\n```\n\n\n### Installing from source\n\nDownload source code and run from inside the project root:\n\n```shell\n$ b2 install --prefix=/path/to/installation/prefix\n```\n\n\n## Usage\n\n``` c++\n#include \u003cflags/flags.hpp\u003e\n\nenum class MyEnum { Value1 = 1 \u003c\u003c 0, Value2 = 1 \u003c\u003c 1 };\nALLOW_FLAGS_FOR_ENUM(MyEnum)\n\nint main() {\n  auto mask1 = MyEnum::Value1 | MyEnum::Value2; // set flags Value1 and Value 2\n  if (mask1 \u0026 MyEnum::Value2) { // if Value2 flag is set\n    /* ... */\n  }\n}\n```\n\nMore info can be found in the [docs](http://grisumbras.github.io/enum-flags/).\n\n\n## Maintainer\n\nDmitry Arkhipov \u003cgrisumbras@gmail.com\u003e\n\n\n## Contributing\n\nPatches welcome!\n\n\n## License\n\n[MIT (C) Dmitry Arkhipov.](LICENSE)\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrisumbras%2Fenum-flags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrisumbras%2Fenum-flags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrisumbras%2Fenum-flags/lists"}