> Awesome. =)
It is, though the syntax is still evolving, but initial decision about
is what interests me as it differs a lot from C++. Delphi syntax seems to
copy from C++ as is.
--
View this message in context:
http://free-pascal-general.1045716.n5.nabble.com/Generic-specialization-using-mo
On Tue, Nov 11, 2014 at 7:25 PM, Sven Barth
wrote:
> On 11.11.2014 22:48, silvioprog wrote:
>
>> Oh, sorry. Just:
>>
>> unit Core.Singleton;
>>
>> {$mode objfpc}{$H+}
>>
>> interface
>>
>> type
>>
>>{ TSingleton }
>>
>>generic TSingleton = class(TObject)
>>public
>> class functio
On 11.11.2014 22:48, silvioprog wrote:
Oh, sorry. Just:
unit Core.Singleton;
{$mode objfpc}{$H+}
interface
type
{ TSingleton }
generic TSingleton = class(TObject)
public
class function GetInstance: T;
end;
implementation
{ TSingleton }
class function TSingleton.GetInstan
On Tue, Nov 11, 2014 at 5:34 PM, silvioprog wrote:
> On Sat, Nov 1, 2014 at 1:54 AM, leledumbo
> wrote:
>
>> > Hm... so I'll choose the mode delphi in my new projects to type less
>> code
>> hehe...
>>
>> You actually ended up typing much less using objfpc style generics. Think
>> of
>> how many
On Sat, Nov 1, 2014 at 1:54 AM, leledumbo
wrote:
> > Hm... so I'll choose the mode delphi in my new projects to type less code
> hehe...
>
> You actually ended up typing much less using objfpc style generics. Think
> of
> how many angle brackets you would need to type in Delphi mode? And how many
> Hm... so I'll choose the mode delphi in my new projects to type less code
hehe...
You actually ended up typing much less using objfpc style generics. Think of
how many angle brackets you would need to type in Delphi mode? And how many
if the specialized type changes? ;)
Delphi generics can actua
On Fri, Oct 31, 2014 at 12:01 AM, Kiên Nguyễn Tiến Trung
wrote:
> AFAIK, you must create a new type:
>
> type
> TMyGenericInt = specialize TMyGeneric;
> var
> VMyGenericInt: TMyGenericInt;
>
> begin
> VMyGenericInt:= TMyGenericInt.Create;
> VMyGenericInt.Value := 2014;
> VMyGe
AFAIK, you must create a new type:
type
TMyGenericInt = specialize TMyGeneric;
var
VMyGenericInt: TMyGenericInt;
begin
VMyGenericInt:= TMyGenericInt.Create;
VMyGenericInt.Value := 2014;
VMyGenericInt.Free;
end.
2014-10-31 2:14 GMT+07:00 silvioprog :
> Hello,
>
> How to use t
Hello,
How to use this code below in mode objfpc?:
TMyGeneric = class(TObject)
private
FValue: T;
public
property Value: T read FValue write FValue;
end;
...
var
VMyGenericStr: TMyGeneric;
VMyGenericInt: TMyGeneric;
begin
VMyGenericStr := TMyGeneric.Create;
VMyGenericStr