rttrorg / rttr

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

Can I cast a rttr::type to one of my own types? #341

Closed dame-time closed 1 year ago

dame-time commented 2 years ago

What I wish to achieve is to covert t into a "normal" type like that:

    auto t = rttr::type::get_by_name("Component");
    obj->addComponent<t>();

is this possible?

dame-time commented 1 year ago

It was a fairly easy task, I just simply set a father abstract class Component and then cast all my classes to the father class. Sorry for the dumb question.