Is there a way to overload a function based on different Result type in Delphi? -


There is a very detailed answer on the logical overloading function with return type, and I can see that Delphi does not allow this, but is there any way to overload the function on the basis of different return types in Delphi?

  type TFoo = record class operator Implicit (const aufoo: TFoo) :  
  Type: integer; Class Operator Implicant (Conf Fu: TFU): String; End;  

Depending on the context, using the value of type, TFoo is called a proper underlying conversion. If the overloaded routine is trying to use the value of TFoo as an argument, which can take an integer or string in that condition, then a surcharge error will occur:

  Test.pas (33) Error: E2251 Suspect Overloaded Call 'Q' + Test.pas (19) Related Method: Process Q (integer); + Test.pas (24) Related Method: Process Question (const string);  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -