On Mon, Nov 16, 2009 at 1:39 PM, Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > For this reason, I think the Delphi operator naming decision is actually > better than FPC's. Limiting them to classes is another matter. > > > Jonas
Jonas, Delphi doesn't limit operator overloading to classes. You can also add overloading to in (addition to methods and inlining) records. TVec3 = record {$IFDEF D10_UP} function Cross(const V: TVec3): TVec3; inline; function Dot(const V: TVec3): Float; inline; procedure Normalize; inline; class operator Add(const A, B: TVec3): TVec3; inline; class operator Subtract(const A, B: TVec3): TVec3; inline; class operator Multiply(const A, B: TVec3): TVec3; inline; class operator Multiply(const A: TVec3; B: Float): TVec3; inline; class operator Divide(const A, B: TVec3): TVec3; inline; class operator Divide(const A: TVec3; B: Float): TVec3; inline; {$ENDIF} case Integer of 0: (X, Y, Z: Float); 1: (R, G, B: Float); 2: (Red, Green, Blue: Float); 3: (Heading, Pitch, Roll: Float); 4: (Hue, Saturation, Lightness: Float); 5: (V: array[0..2] of Float); end; PVec3 = ^TVec3; _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal