O'Reilly logo
  • LI WEI thinks this is interesting:

The absence of a forward declaration will give a compiler error, since the compiler won't have heard of class APickupItem before compiling the code in class AAvatar. The compiler error will come at the declaration of the APickupItem::Pickup( APickupItem *item ); function prototype declaration.

From

Cover of Learning C++ by Creating Games with UE4

Note

如果没有前置声明,编译器就会报错