rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.18k stars 441 forks source link

Assign metadata to a type #42

Closed MicBe closed 7 years ago

MicBe commented 7 years ago

Hello,

Is it possible to assign metadata (like we can do for properties) to a type?

I would like to do something like this:

registration::class_("MyClass").metadata(UserFriendlyName, "My Class");

Thanks

acki-m commented 7 years ago

Yes it is possible. Something like this should work:

registration::class_<MyClass>("MyClass")( metadata(UserFriendlyName, "My Class") );

http://www.rttr.org/doc/master/classrttr_1_1registration_1_1class__.html#a17d658b8d88ce353d0ad777d1b01a360

MicBe commented 7 years ago

Thank you!