Hi,
@cbdc
I'm very sorry for that!!!
I didn't find any example with operator overloading in a class.
Just overloading of Records.
The problem come with vector2u.
If anybody have an example with overloading operators in classes, I'm interested (Form based application)
Example:
operator + (const V1: Vector2; Val: Single): Vector2;
begin
// result.X := V1.X + Val; // <-- Solution one crashes because result is not initialized.
// result.Y := V1.Y + Val;
exit(Vector2.Create(V1.X + Val, V1.Y + Val)); // Solution 2 works but didn't free the memory
end;
B->