Quote Originally Posted by User137
There's interesting thing about C++ very weird to pascal programmers, it can do this with vectors:

c = a+b;

Where pascal is forced to manually iterate it or write function to it:

c.x := a.x+b.x;
c.y := a.y+b.y;

This is just a simple a+b but when it comes to vectors this kind of math can prove really useful. But for this simplicity much complexity lies behind the surface...

If only pascal had more support, it could be great.
operator +(v1, v2: TVector2d): TVector2d;
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.