Почему не получается создать объект класса, унаследованного от шаблонного класса?
Есть вот такие 2 шаблонных класса
template <typename DataType>
class IGeoIndexer {
public:
virtual void Insert(const DataType& object, const GeoIndex::Coordinate& coordinate) = 0;
virtual ~IGeoIndexer() = 0;
};
template<typename DataType>
IGeoIndexer<DataType>::~IGeoIndexer() {
}
template <typename DataType>
class QuadTreeGeoIndexer : public IGeoIndexer<DataType>{
private:
static const size_t optimalDeep = 14;
QuadTree<DataType, std::vector<DataType>> quadTree;
public:
QuadTreeGeoIndexer();
QuadTreeGeoIndexer(const Coordinate& northWest, const Coordinate& northEast,
const Coordinate& southWest, const Coordinate& southEast, size_t deep = optimalDeep);
~QuadTreeGeoIndexer() override = default;
void Insert(DataType data, const GeoIndex::Coordinate& coordinate) override;
};
template<typename DataType>
QuadTreeGeoIndexer<DataType>::QuadTreeGeoIndexer() :
quadTree(worldNorthWest, worldNorthEast, worldSouthWest, worldSouthEast, optimalDeep)
{
}
template<typename DataType>
QuadTreeGeoIndexer<DataType>::QuadTreeGeoIndexer(const Coordinate &northWest, const Coordinate &northEast,
const Coordinate &southWest, const Coordinate& southEast, size_t deep) :
quadTree(northWest, northEast, southWest, southEast, deep)
{
}
template<typename DataType>
void QuadTreeGeoIndexer<DataType>::Insert(DataType data, const GeoIndex::Coordinate &coordinate) {
Coordinate coord(coordinate.latitude(), coordinate.longitude());
quadTree.CreateOrFindQuadrant(data, coord, [](const DataType data, std::vector<DataType> dataContainer,
const Coordinate&, bool){
dataContainer.push_back(data);
});
}
Я пытаюсь создать объект класса QuadTreeGeoIndexer
int main() {
IGeoIndexer<int>* GeoIndexer = new QuadTreeGeoIndexer<int>();
return 0;
}
Но компилятор выдает мне ошибку.
In instantiation of template class 'QuadTreeGeoIndexer'
Не могу понять, как сделать так, чтоб я мог сконструировать класс наследник из указателя предка.
