Circular dependencies of declarations

前端 未结 6 1174
眼角桃花
眼角桃花 2021-01-19 05:02

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,

6条回答
  •  花落未央
    2021-01-19 05:40

    I haven't write complex C++ program in a long time but if I remember correctly, you should out the skeleton of those classes in .h file with the same name with this .c file. Then include it into this .c file.

    Hope this helps.

提交回复
热议问题