Cast

    [Unreal] 업/다운캐스팅 (Cast 함수) 동작 원리

    실제로 언리얼의 Cast 는 다음과 같이 구현되어 있다 : // Dynamically cast an object type-safely. template FORCEINLINE To* Cast(From* Src) { return TCastImpl::DoCast(Src); } 내부적으로 TCastImpl 을 부르고 있다 template struct TCastImpl { // This is the cast flags implementation FORCEINLINE static To* DoCast( UObject* Src ) { return Src && Src->GetClass()->HasAnyCastFlag(TCastFlags::Value) ? (To*)Src : nullptr; } FORCEINLINE sta..