Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "refl.hpp"
- struct Point {
- float x, y;
- };
- REFL_TYPE(Point)
- REFL_FIELD(x)
- REFL_FIELD(y)
- REFL_END
- int main() {
- Point pt{ 0.f, 5.f };
- for_each(refl::reflect(pt).members, [&](auto member) {
- std::cout << member.name << " = " << member(pt) << ";";
- });
- /// Prints
- /// x=0;y=0.5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement