Registriert seit: 7. Jan 2008
Ort: Baden Württemberg- Hohenlohekreis
174 Beiträge
RAD-Studio 2009 Arc
|
operator überladen
16. Mai 2009, 16:46
hallo freunde der sonne, ich möchte den operator + überladen. dummerweise kennt mein compiler den class operator add nicht. hier der quelltext:
Delphi-Quellcode:
unit uvektor;
interface
uses types,math;
type
tvektor=packed record
x,y,z:extended;
class operator add( const a,b:tvektor):tvektor;
end;
implementation
class operator add( const a,b:tvektor):tvektor;
begin
result.x:=a.x+b.x;
result.y:=a.y+b.y;
result.z:=a.z+b.z;
end;
wo liegt der fehler?
Volker ~beware
Wizards First Rule:
People are stupid; given proper motivation, almost anyone will believe almost anything. Because people are stupid, they will believe a lie because they want to believe it’s true, or because they are afraid it might be true
|