operator +(v1, v2: TVector2d): TVector2d;Originally Posted by User137
begin
Result.x := v1.x + v2.x;
Result.y := v1.y + v2.y;
end;
This is EXACTLY the same what C++ does. I wouldn't be surprised if these operators were defined in unit matrix... but you can always do them yourself (the C++ lib you used probably had exactly code like that somewhere).
This is of course FPC specific extension, and quite looked down upon.
Overloading operators is sometimes nifty, but can cause a hell lot of trouble.
Bookmarks