Download

Any way to implement custom type casting?

Hello! I’m just translating some c# code libraries into UE4 c++, and i’m asking some questions to myself.
For instance, i find that line of code in my C# files:


static implicit operator IntVector2D(Point point) = > new IntVector2D(point.X, point.Y);

It’s a implicit operator intended for custom type casting.

Of course, i can made a constructor taking some type like Point as in param, and return a FIntVector2D; BUT, after reading some more about UE4 C++ type casting, I’m wondering about if it’s posible to override custom type casting in any way inside my code.

Any advices?