So to summarize I have something equivalent to
class A{
public:
virtual void foo() const = 0;
};
class B : public A{
public:
B(){};
void foo() const override{
//some code
};
};
class C{
public:
C(){};
B someFunction();
private:
A* x;
};
and A* x;
points to some B
object and I need someFuntion()
to return that object that x is pointing to. I've tried just doing return *x
but that doesn't work.