Shape.h
namespace Graphics {
class Shape {
public:
virtual void Render(Point point) {};
};
}
Rect.h
namespa
No, it is not casting.
You can instead store a reference to baseclass Point:
struct ShapePointPair {
Shape shape;
Point &location;
};
This reference must be set at construction time for struct ShapePointPair. Add a constructor to ShapePointPair for this purpose. It must be passed (newly created) instances of Rect.
Also observe the memory management responsiblities (proper written destructors, etc.).