@class vs. #import

后端 未结 16 1050
渐次进展
渐次进展 2020-11-21 22:42

It is to my understanding that one should use a forward-class declaration in the event ClassA needs to include a ClassB header, and ClassB needs to include a ClassA header t

16条回答
  •  说谎
    说谎 (楼主)
    2020-11-21 23:38

    Forward declaration just to the prevent compiler from showing error.

    the compiler will know that there is class with the name you've used in your header file to declare.

提交回复
热议问题