I have some code which seems similair to this:
#include <iostream>
class Base {
public:
void test() {
std::cout << "Base::test()" << std::endl;
}
void test2() {
test();
}
};
class Derived : public Base {
public:
void test() {
std::cout << "Derived::test()" << std::endl;
}
};
int main() {
Derived d;
d.test2();
return 0;
}
Now this outputs ofcourse Base::test()
, however I want it to output Derived::test()
without making use of virtual function calls and using an different notation for the function overload called: Derived::test
.
Does someone know if this is possible to achieve?