I have a function that I want to execute for all types in a type list (currently represented by a list of mpl --- is that even a reasonable way to approach it?)
The key here is that a function only cares about the type, not the actual data; it calls a static function in this type to get some information, and then translates it into a hash table for later reference.
However, as far as I can tell, mpl has no means for this - the closest I can find is the mpl for_each operator, but it seems to want to be used for actual instances of each of the types, not the types themselves.
There was a “apply” function in the Loki library, which is more or less what I'm looking for - it circumvented the problem of creating an instance by passing a pointer to a type in the type list as a parameter that will help with subtraction, but without making a full instance. What should I look in MPL to get this functionality? Or am I missing something obvious?
Kozaki
source share