Two classes and inline functions

前端 未结 3 920
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-03 05:52

I have two classes and both of them uses some of the other class, on example:

// class1.h
class Class1;
#include \"class2.h\"

class Class1 {
  public:
  sta         


        
3条回答
  •  攒了一身酷
    2021-01-03 06:26

    My suggestion is that you place common methods and members into a base class, then derive C1 and C2 from the base class. This may fix the circular dependency issue.

提交回复
热议问题