{"id":20773375,"url":"https://github.com/serpent7776/any_of","last_synced_at":"2026-05-28T07:31:23.214Z","repository":{"id":151492412,"uuid":"370457967","full_name":"serpent7776/any_of","owner":"serpent7776","description":"A library to compare value against many values.","archived":false,"fork":false,"pushed_at":"2021-07-31T16:18:34.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T19:37:19.435Z","etag":null,"topics":["compare","cplusplus","library","operator"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serpent7776.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-24T19:04:56.000Z","updated_at":"2022-01-26T19:09:44.000Z","dependencies_parsed_at":"2023-06-07T07:45:37.120Z","dependency_job_id":null,"html_url":"https://github.com/serpent7776/any_of","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/serpent7776/any_of","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpent7776%2Fany_of","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpent7776%2Fany_of/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpent7776%2Fany_of/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpent7776%2Fany_of/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serpent7776","download_url":"https://codeload.github.com/serpent7776/any_of/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serpent7776%2Fany_of/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33599465,"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-05-28T02:00:06.440Z","response_time":99,"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":["compare","cplusplus","library","operator"],"created_at":"2024-11-17T12:25:33.354Z","updated_at":"2026-05-28T07:31:23.195Z","avatar_url":"https://github.com/serpent7776.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# any_of\n\n## Introduction\n\nA simple library that lets you compare a value against many values using one operator.\n\nE.g.\n```c++\nx == srp::any_of(1, 2, 3, 4);\n```\n\nis equivalent to:\n```c++\nx == 1 || x == 2 || x == 3 || x == 4;\n```\n\nBesides `any_of`, library also provides `none_of`, `all_of` and `one_of`. All of them override `operator==` in an expected way:\n\n`x == srp::none_of(1, 2, 3)` is equivalent to `x != 1 \u0026\u0026 x != 2 \u0026\u0026 x != 3`\n`x == srp::all_of(1, 2, 3)` is equivalent to `x == 1 \u0026\u0026 x == 2 \u0026\u0026 x == 3`\n`x == srp::one_of(1, 2, 3)` is equivalent to `(x == 1) + (x == 2) + (x == 3) == 1`\n\n## Custom functions\n\nIn addition to these functions, you can define your own functions with custom behaviour using `srp::make_custom_of`. It is a function template taking operator structs defining operators that should be available and return a lambda that can be called just like `srp::any_of`.\nOperator struct should define an operator as a friend function.\nLibrary provides `srp::EqOp` that provides `operator==` and `srp::NeqOp` that provides `operator!=`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserpent7776%2Fany_of","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserpent7776%2Fany_of","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserpent7776%2Fany_of/lists"}