At around 4:35, we forward declare “class AGun;” – some IDEs like Rider for UE4 will automatically fill in the #include “Gun.h”. At what point should we forward declare versus #include? Is it because we’ve already #included “Gun.h” in the .cpp file?
Yeah, avoid the include. It’s explained in the Coding Standard. Basically, forward declarations save you compile time by keeping the size of the headers to a minimum.