Better explained in code than with words:
//Classes.hpp
struct Base
{
virtual void foo() = 0;
};
struct Derived : public Base
{
//Nothing here
};
//Classes.cpp
void Derived::foo()
{
//Do something here
}
I saw this compile without errors, but it strikes me as odd that you don’t have to explicitly state in class Derived that you are going to implement “foo”.
Is this supposed to work according to the C++ standard?
Don’t know what compiler you’re using but this is not legal c++. My VC and gcc return the expected error when compiling this code.