Why does it make zero sense in C++?
edit: simplified example of what i mean
struct A {
virtual void DoSomething() = 0;
};
struct B : A {
void DoSomething() override {
std::println("B");
}
};
struct C : A {
void DoSomething() override {
std::println("C");
}
};
void InvokeDoSomething(A* a) {
a->DoSomething();
}
vs
struct B {
void DoSomething() {
std::println("B");
}
};
struct C {
void DoSomething() {
std::println("C");
}
};
template <typename T>
void InvokeDoSomething(T* t) {
t->DoSomething();
}