#include #include "fix2.hpp" #include using std::cout; void RenderTarget::draw(const Drawable& drawable) { drawable.draw(*this); } void Shape::draw(RenderTarget& target) const { assert(false && "You should not call this, use shape.draw(target) instead."); } void Shape::draw(RenderTarget &target) { cout << "shape renders without const instead\n"; } int main() { RenderTarget target; Shape shape; // uncomment this to see the error when used wrong // target.draw(shape); shape.draw(target); return 0; }