Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

smart pointer 8 years 7 months ago #9628

  • sakata
  • sakata's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 1
  • Thank you received: 0
Hi,

I want to smart pointer.
I want to convert the code of Delphi to FreePascal
type
  Auto<T: class> = reference to function: T;

  TAuto<T: class> = class(TInterfacedObject, Auto<T>)
  private
    FValue: T;
  public
    constructor Create(AValue: T);
    destructor Destroy; override;
    function Invoke: T;
  end;

  Auto = class
  public
    class function Wrap<T: class>(AValue: T): Auto<T>; static;
  end;
>> Compile Error: interface type expected, but got "TAuto$1.<procedure variable type of function:T of object;Register>"

Please Log in or Create an account to join the conversation.

smart pointer 8 years 7 months ago #9630

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4540
  • Thank you received: 1117
Please Sir
read this

PS: For your info,
many PilotLogic programmers, don't like Delphi Pascal with generics.
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.
  • Page:
  • 1