Will the following code compile?
template <class T=void> // 1
struct A {
  int a;
};

template <>
struct A<int> {
  char c; // 2
};

void Test() {
  A<>().a; // 3
  A<int>().c; // 4
}

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes