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
Зареєструйся Зараз
або Підпишись на майбутні тести