Operator Overloading in Delphi -
is possible (in delphi) overload operators in classes. i've read time ago possible records found information classes in code below:
type tmyclass = class class operator implicit(a: integer): tmyclass; end; class operator tmyclass.implicit(a: integer): tmyclass; begin // ... end;
it (modified) address: http://docs.embarcadero.com/products/rad_studio/delphiandcpp2009/helpupdate2/en/html/devcommon/operatoroverloads_xml.html
but when try use (inside delphi xe) get:
procedure, function, property, or var expected (e2123)
i want create own simple class matrix manipulating , possibility of using overloading opearators inside class expected opportunity.
regars, artik
operator overloading classes available in versions of compiler. available .net , ios compilers. windows , mac is not supported.
the ios compiler can support because manages lifetime of class instances using arc. if desktop compilers ever switch arc can expect support operator overloading.
marco has blogged this: http://blog.marcocantu.com/blog/class_operators_delphi.html
Comments
Post a Comment