The helper function FLyraGameplayEffectContext::ExtractEffectContext takes care of casting context pointers to the specialized types. Currently, this is used in the FLyraGameplayAbilityTargetData_SingleTargetHit structure.