{"id":21380411,"url":"https://github.com/redskittlefox/reflexpr","last_synced_at":"2025-07-13T13:30:36.109Z","repository":{"id":178203760,"uuid":"400230238","full_name":"RedSkittleFox/reflexpr","owner":"RedSkittleFox","description":"Compile time struct Reflections","archived":false,"fork":false,"pushed_at":"2024-01-22T08:40:54.000Z","size":41,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-22T11:21:54.574Z","etag":null,"topics":["aggregates","cpp","cpp20","cpp20-library","cpp23","header-only","reflections","structs"],"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/RedSkittleFox.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}},"created_at":"2021-08-26T16:09:29.000Z","updated_at":"2024-01-21T20:25:54.000Z","dependencies_parsed_at":"2024-01-01T05:21:06.358Z","dependency_job_id":"56366d34-875d-4a57-869f-a22d6ece8c21","html_url":"https://github.com/RedSkittleFox/reflexpr","commit_stats":null,"previous_names":["redskittlefox/ruby-reflexpr","redskittlefox/reflexpr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedSkittleFox%2Freflexpr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedSkittleFox%2Freflexpr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedSkittleFox%2Freflexpr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RedSkittleFox%2Freflexpr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RedSkittleFox","download_url":"https://codeload.github.com/RedSkittleFox/reflexpr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225885811,"owners_count":17539640,"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":["aggregates","cpp","cpp20","cpp20-library","cpp23","header-only","reflections","structs"],"created_at":"2024-11-22T10:40:15.135Z","updated_at":"2024-11-22T10:40:15.719Z","avatar_url":"https://github.com/RedSkittleFox.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CMake on multiple platforms](https://github.com/RedSkittleFox/reflexpr/actions/workflows/cmake-multi-platform.yml/badge.svg)](https://github.com/RedSkittleFox/reflexpr/actions/workflows/cmake-multi-platform.yml)\n\n# reflexpr\nis a c++20 compile and runtime aggregate reflections header only library. It allows you to iterate over aggregate type's member variables.\n\n# Example Usage\n```cpp\n#include \u003ciostream\u003e\n#include \u003cstring\u003e\n#include \u003cfox/reflexpr.hpp\u003e\n\nstruct my_aggregate\n{\n\tint a;\n\tfloat b;\n\tstd::string c;\n\tint\u0026 d;\n};\n\nint main()\n{\n\tint d = 5;\n\tmy_aggregate obj\n\t{\n\t\t.a = 1 ,\n\t\t.b = 3.5f,\n\t\t.c = \"Foxes are great!\",\n\t\t.d = d\n\t};\n\n\tauto\u0026\u0026 [v0, v1, v2, v3] = obj;\n\n\t// Get Nth member - fox::reflexpr::get\u003cN\u003e(aggregate)\n\tstd::cout \u003c\u003c fox::reflexpr::get\u003c0\u003e(obj) \u003c\u003c '\\n'; // prints obj.a \n\t\n\t// Iterate over members - fox::reflexpr::for_each(aggregate, func)\n\tfox::reflexpr::for_each(obj, [](auto\u0026\u0026 v) {std::cout \u003c\u003c v \u003c\u003c ' '; }), std::cout \u003c\u003c '\\n';\n\n\t// Create a tuple-tie from members - fox::reflexpr::tie(aggregate)\n\tauto tie = fox::reflexpr::tie(obj);\n\tstd::cout \u003c\u003c (std::get\u003c2\u003e(tie) = 2) \u003c\u003c '\\n';\n\n\t// Create a tuple from members - fox::reflexpr::make_tuple(aggregate)\n\tauto tuple = fox::reflexpr::make_tuple(obj);\n\tstd::cout \u003c\u003c (std::get\u003c2\u003e(tuple)) \u003c\u003c '\\n';\n\n\t// Tuple size - fox::reflexpr::tuple_size_v\u003caggregate_type\u003e\n\tstatic_assert(fox::reflexpr::tuple_size_v\u003cmy_aggregate\u003e == static_cast\u003cstd::size_t\u003e(4));\n\n\t// Tuple Nth type\n\tstatic_assert(std::is_same_v\u003cfox::reflexpr::tuple_element_t\u003c3, my_aggregate\u003e, int\u0026\u003e);\n\n\treturn 0;\n}\n```\n\n# Limitation\nRight now it supports only up to 40 member variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredskittlefox%2Freflexpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredskittlefox%2Freflexpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredskittlefox%2Freflexpr/lists"}