Skybuck Flying
2011-07-11 04:47:33 UTC
Hello,
Currently I have a class somewhat like so:
TSomeObject<GenericType> = class
protected
mStorage : GenericType
public
// not possible :)
// property Value : GenericType read mStorage; default;
property Value : GenericType read mStorage;
// other stuff
end;
I would like to be able to write code as follows:
var
A : TSomeObject<integer>;
B : TSomeObject<integer>;
C : integer;
begin
C := A; // not possible.
// must write:
C := A.Value;
end;
Having to write .Value everytime is kinda annoying and looks bad.
I wish it was possible to use a non-indexed property as the default.
Then I hope I could also use it for:
SetLength( something, A );
Bye,
Skybuck.
Currently I have a class somewhat like so:
TSomeObject<GenericType> = class
protected
mStorage : GenericType
public
// not possible :)
// property Value : GenericType read mStorage; default;
property Value : GenericType read mStorage;
// other stuff
end;
I would like to be able to write code as follows:
var
A : TSomeObject<integer>;
B : TSomeObject<integer>;
C : integer;
begin
C := A; // not possible.
// must write:
C := A.Value;
end;
Having to write .Value everytime is kinda annoying and looks bad.
I wish it was possible to use a non-indexed property as the default.
Then I hope I could also use it for:
SetLength( something, A );
Bye,
Skybuck.