lundi 27 avril 2020

Possible create an array of different structures in C++

I have some struct like this:

struct A { ... };
struct B { ... };

And I have a template like this:

template<typename struct_arg>
class X { ... }

Now I wanna create an array of arguments as struct like this:

args [2] { A, B };

for (args) {
    X<args[i]> x;
}

Can I possible to create an array like this!?

Aucun commentaire:

Enregistrer un commentaire