Jonas Maebe wrote:
Assert(TypeOf(qt) = TypeOf(result));
This is always true. Everything descends from TOBject.
But assuming the result is not TObject, it would be
Assert((qt=Nil) or (qt.Inheritsfrom(TheResultClass))
So again skipping the nil check for simplicity, this compiles but are
the se
Michael Van Canneyt wrote:
On Mon, 6 Jan 2014, Mark Morgan Lloyd wrote:
Michael Van Canneyt wrote:
On Sun, 5 Jan 2014, Mark Morgan Lloyd wrote:
Simulating a C-style conditional, I can do this
function tf(const q: qword; const qt, qf: TObject): TObject; inline;
begin
Assert(TypeOf(qt) = Ty
On 06 Jan 2014, at 10:31, Michael Van Canneyt wrote:
On Mon, 6 Jan 2014, Mark Morgan Lloyd wrote:
Michael Van Canneyt wrote:
On Sun, 5 Jan 2014, Mark Morgan Lloyd wrote:
Simulating a C-style conditional, I can do this
function tf(const q: qword; const qt, qf: TObject): TObject;
inline;
b
On Mon, 6 Jan 2014, Mark Morgan Lloyd wrote:
Michael Van Canneyt wrote:
On Sun, 5 Jan 2014, Mark Morgan Lloyd wrote:
Simulating a C-style conditional, I can do this
function tf(const q: qword; const qt, qf: TObject): TObject; inline;
begin
Assert(TypeOf(qt) = TypeOf(result));
This is a
Michael Van Canneyt wrote:
On Sun, 5 Jan 2014, Mark Morgan Lloyd wrote:
Simulating a C-style conditional, I can do this
function tf(const q: qword; const qt, qf: TObject): TObject; inline;
begin
Assert(TypeOf(qt) = TypeOf(result));
This is always true. Everything descends from TOBject.
Bu
On Sun, 5 Jan 2014, Mark Morgan Lloyd wrote:
Simulating a C-style conditional, I can do this
function tf(const q: qword; const qt, qf: TObject): TObject; inline;
begin
Assert(TypeOf(qt) = TypeOf(result));
This is always true. Everything descends from TOBject.
But assuming the result is n
Simulating a C-style conditional, I can do this
function tf(const q: qword; const qt, qf: TObject): TObject; inline;
begin
Assert(TypeOf(qt) = TypeOf(result));
which- as I understand it- checks that the types are strictly the same.
How do I relax this to only ensure that the parameter is
as