Will the following code compile?
template <class T>
struct A {
  template <class K> void Foo() {
    typename K::test(T())->bar(10 - K(), A())++;
  }
};

void Test() {
  A<int> a;
}
Explanation
Yes, since A<T>::Foo<K>() is never called, so the compiler will not generate code for this method.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по C++
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты