【发布时间】:2015-10-14 13:14:45
【问题描述】:
如何在函数参数中使用默认常量指针? nil 有效,但常规指针无效。
program Project1;
type
TFoo = function(const A, B): Integer;
function FooA(const A, B): Integer; inline;
begin
WriteLn('FooA');
end;
function FooB(const A, B): Integer; inline;
begin
WriteLn('FooB');
end;
procedure Something(const Foo: TFoo = @FooA); // Constant expression expected
begin
end;
begin
Something(FooB);
end.
【问题讨论】:
标签: delphi delphi-xe8