How about smart pointer + forward declaration?
…If I add a smart pointer (e.g. std::unique_ptr) as a member in APickup, and forward declares CustomClass in Pickup.h and put the #include directive in Pickup.cpp, I get the compile error C2338 “can’t delete an incomplete type”. Any ideas on how to solve this without putting the #include in the header?
I suspect that the GENERATED_BODY() macro causes this.
(in my case CustomClass is a completely non-UE class, which is why I want to manage lifetime myself)