lock3 / meta

122 stars 11 forks source link

How to iterate class template types? #272

Open nilres opened 4 years ago

nilres commented 4 years ago

This is probably not really an issue in the code but I'm just not able to figure it out...

How can I iterate the template types of a class?

I thought maybe something like this could work but it doesn't:

template<typename T1, typename T2>
class template_class {
};

consteval {
    auto classInfo = reflexpr(template_class<int, float>);

    for(auto templateSpec : meta::template_param_range(classInfo)) {

    }
}

I also tried with member_range and other iterators but it seems impossible to figure out what the tempate types are.

Thanks for the help.