Use override instead of virtual for subclasses.

Now that we are using c++11, it is safer to use override in subclasses
instead of virtual.

This CL does it for the interface, a follow up CL will do it for
other parts of the code base.

Change-Id: Ice8d0f4355cb700019d7a9c1566fbff0099e97d6
This commit is contained in:
Sameer Agarwal
2019-07-13 11:19:27 +02:00
parent 3e5db5bc27
commit e4577dd6d9
12 changed files with 114 additions and 121 deletions
@@ -83,9 +83,9 @@ class DynamicAutoDiffCostFunction : public DynamicCostFunction {
virtual ~DynamicAutoDiffCostFunction() {}
virtual bool Evaluate(double const* const* parameters,
double* residuals,
double** jacobians) const {
bool Evaluate(double const* const* parameters,
double* residuals,
double** jacobians) const override {
CHECK_GT(num_residuals(), 0)
<< "You must call DynamicAutoDiffCostFunction::SetNumResiduals() "
<< "before DynamicAutoDiffCostFunction::Evaluate().";