class Base
{
public:
virtual void foo() = 0;
};
"Implement Virtual Methods..." generates this code:
class Derived
{
virtual void foo()
{
throw std::exception("The method or operation is not implemented.");
}
};
From http://stackoverflow.com/questions/1569726/difference-stdruntime-error-vs-stdexception:
"std::exception is the class whose only purpose is to serve as the base class in the exception hierarchy. It has no other uses. In other words, conceptually it is an abstract class"
Throw std::runtime_error instead of std::exception!
Otherwise gcc generates errors like "std::exception" is abstract...
Add a checkbox that adds the override keyword to an overwritten virtual method
Example:
class Derived2
{
virtual void foo() override
{
throw std::runtime_error("The method or operation is not implemented.");
}
};