jeudi 12 septembre 2019

Using a member struct of a templated class

Is it possible to use the member struct or enum class of a templated class, without explicitly specifying the template arguments. So for ex:

template<typename A, typename B>
class Foo {
 public:
  enum class Status {E1, E2, E3};
};

void func() {
  auto e = Foo::Bar::E1;
}

I guess I see the point that the compiler needs to instantiate Foo given its template arguments, but just wondering if there is a way around to still use its member class.

Aucun commentaire:

Enregistrer un commentaire