I am trying to implement example of visitor pattern, but I have trouble with circular dependecies of declarations of classes. When I do forward declaration of class Visitor,
class Visitor;
class England : public Land {
public:
void accept(const Visitor *v); // Only declaration
};
// Define Visitor
class Visitor {
//...
};
// Now implementation
void England::accept(const Visitor *v) {
v->visit(this);
}