@class vs. #import

后端 未结 16 1312
渐次进展
渐次进展 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:31

    Another advantage: Quick compilation

    If you include a header file, any change in it causes the current file also to compile but this is not the case if the class name is included as @class name. Of course you will need to include the header in source file

提交回复
热议问题