Straight to the point:
- I have an abstract class called
Chart<IType>
with childCandlestickChart<CandlestickChartItem>
etc. - ... an abstract class called
ChartItem
with childCandlestickChartItem
etc. - ... an abstract class called
ChartSelection
with childCandlestickChartSelection
etc.
Relevant piece of code:
/* --- CHARTS --- */
template <typename IType>
class Chart {
...
typedef std::vector<IType> ChartData;
}
class CandlestickChart :
public Chart<CandlestickChartItem> { }
/* --- CHART SELECTIONS --- */
template <typename ChartType>
class ChartSelection {
...
virtual ChartType::ChartData::const_iterator findStart() = 0;
};
class CandlestickChartSelection : public ChartSelection<CandlestickChart> {
...
CandlestickChart::ChartData::const_iterator findStart() override;
};
How compiler feels about this:
Error C2253 'ChartSelection<CandlestickChart>::findStart':
pure specifier or abstract override specifier only allowed on virtual function
Error C3668 'CandlestickChartSelection::findStart':
method with override specifier 'override' did not override any base class methods
TL;DR: Why does my compiler think that the method findStart
in the child class is different from the virtual function in the parent class?
Is there a simple way to solve this?