All pastes #885714 Raw Edit

Mine

public cpp v1 · immutable
#885714 ·published 2008-01-31 01:59 UTC
rendered paste body
#include <string>#include <iostream>class SceneGraph;class Entity {  public:	virtual void deleteE(SceneGraph* e);};using namespace std;class Entity;class SceneGraph {  public:	void deleteE(Entity* e);	void print(string s);};class SpecialEntity: public Entity {  public:	virtual void deleteE(SceneGraph* e);};void Entity::deleteE(SceneGraph* graph) {	graph->print("entity::delete()");}void SceneGraph::deleteE(Entity* e) {	e->deleteE(this);}void SceneGraph::print(string s) {	cout << s << "\n";}void SpecialEntity::deleteE(SceneGraph* graph) {	graph->print("SpecialEntity::delete()");}int main() {	Entity e;	SpecialEntity f;	SceneGraph* graph = new SceneGraph();	graph->deleteE(&e);	graph->deleteE(&f);}