{"id":27091454,"url":"https://github.com/avitase/static_rotation","last_synced_at":"2026-07-08T21:31:08.137Z","repository":{"id":90948164,"uuid":"228050016","full_name":"avitase/static_rotation","owner":"avitase","description":"C++ header-only library that uses TMP to generate all rotations of a given integral sequence at compile-time.","archived":false,"fork":false,"pushed_at":"2020-02-12T14:13:40.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-31T21:29:41.096Z","etag":null,"topics":["compile-time","cpp","cpp-library","header-only","rotations","template-m","tmp"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avitase.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":"2019-12-14T16:03:00.000Z","updated_at":"2020-02-12T14:13:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2a80155-f681-45ea-a978-dd549ca9205b","html_url":"https://github.com/avitase/static_rotation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avitase/static_rotation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avitase%2Fstatic_rotation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avitase%2Fstatic_rotation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avitase%2Fstatic_rotation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avitase%2Fstatic_rotation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avitase","download_url":"https://codeload.github.com/avitase/static_rotation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avitase%2Fstatic_rotation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35279442,"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-07-08T02:00:06.796Z","response_time":61,"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":["compile-time","cpp","cpp-library","header-only","rotations","template-m","tmp"],"created_at":"2025-04-06T07:38:23.396Z","updated_at":"2026-07-08T21:31:08.127Z","avatar_url":"https://github.com/avitase.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `static_rotation`\n`static_rotation` is a [header-only](static_rotation.hpp) library that uses template meta programming to generate all rotations of a given integer sequence at compile-time. \n\n## Example\nThe snippet below generates all rotations of the sequence `(0,1,2,3)` and stores them in a `std::array\u003cstd::size_t, 16\u003e`:\n```\n#include \"static_rotation.hpp\"\n#include \u003ciostream\u003e\n\nint main() {\n    using namespace static_rotation;\n    using R = IndexRotations\u003c4\u003e;\n    constexpr auto values = R::values;\n\n    for (int i = 0; i \u003c values.size(); i++) {\n        std::cout \u003c\u003c values[i];\n        std::cout \u003c\u003c (i % R::seq_length  == R::seq_length - 1 ? '\\n' : ' ');\n    }\n\n}\n```\nThe output of this snippet is\n```\n0 1 2 3\n1 2 3 0\n2 3 0 1\n3 0 1 2\n```\nYou can run the snippet on Compiler Explorer: [godbolt.org/z/uNmXFr](https://godbolt.org/z/uNmXFr)\n\n`IndexRotations\u003cN\u003e` generates the rotations for an index sequence `(0, 1, 2, ..., N)`. If the rotations for arbitrary sequences are needed, one may use `Rotations` directly, e.g.\n```\nRotations\u003cint, 4, 8, 15, 16, 23, 42\u003e;\n```\nsee [godbolt.org/z/fWeikA](https://godbolt.org/z/fWeikA) for a complete example.\nFor more details take a look at [static_rotation.hpp](static_rotation.hpp).\n\n## Installatation\nThis library is header-only and including [static_rotation.hpp](static_rotation.hpp) is sufficient.\n\n## Requirements\nThe library uses `C++17` features. No external libraries are needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favitase%2Fstatic_rotation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favitase%2Fstatic_rotation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favitase%2Fstatic_rotation/lists"}