Suppose I have a variadic function like this:
template <typename... A>
void func(A... args)
{
//Do stuff
}
And I have also a map like this:
enum Type{
DOUBLE,
STRING
};
std::map<std::string, Type> map;
So I want to iterate over the elements of the map and call the templated function with the specified types, like: map = {{"a", Type::STRING}, {"1.2", Type::DOUBLE}};
should call func("a", 1.2)
Any hints on how to do that?
Aucun commentaire:
Enregistrer un commentaire