Having an assignment of one struct type variable to another, will the code compile?
template <class T>
struct S { };

struct A { };
struct B : A { };

void Test() {
  S<A> a;
  S<B> b;
  a = b;
}
Explanation
No, since S<B> doesn't inherit S<A>, so compiler can't automatically generate a copy assignment operator.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести