class A{ public: virtual " /> class A{ public: virtual " /> class A{ public: virtual "/>

Method of Class derived from template class "shadows" base class method

59 Views Asked by At

I have defined a class "B" inheriting from a Base abstract class "A" which has a pure virtual method:

A.h

template <class T> 
class A{

public:

    virtual bool doSomething(const T& data) = 0;

};

in B.h

class B : public A<int>{

public:

    bool doSomething(const int& data);   

};

I would have expected Eclipse to say B::doSomething "implements" A::doSomething Instead the compiler says it B::doSomething "shadows" A::doSomething

Why? How can I implement correctly the Base method in Derived class?

Thank you

0

There are 0 best solutions below