#include <iostream>
struct A {
virtual int f(int) {
return 1;
}
};
struct B : A {
template <typename T>
int f(T) {
return 2;
}
};
int main(int argc, char**argv) {
A* pa = new B;
std::cout << pa->f(1) << '\n';
delete pa;
return 0;
}
Login in to like
Login in to comment