-
В модуле для распараллеливания задач System.Threading, есть такие строки: class function &For(Sender: TObject; ALowInclusive, AHighInclusive: Integer; AIteratorEvent: TIteratorEvent): TLoopResult; overload; static; inline; class function &For(Sender: TObject; ALowInclusive, AHighInclusive: Integer; AIteratorEvent: TIteratorEvent; APool: TThreadPool): TLoopResult; overload; static; inline; class function &For(Sender: TObject; ALowInclusive, AHighInclusive: Integer; AIteratorEvent: TIteratorStateEvent): TLoopResult; overload; static; inline; class function &For(Sender: TObject; ALowInclusive, AHighInclusive: Integer; AIteratorEvent: TIteratorStateEvent; APool: TThreadPool): TLoopResult; overload; static; inline; Причем For вызывается без этого символа. Что он означает? Для тех кто не в курсе, при помощи TParallel.For можно разбрасывать расчет задачи (на текущую итерацию i) по потокам (а соответственно по процессорам) автоматически, по тестам получается в 2-3 раза быстрее. http://docwiki.embarcadero.com/RADStudio/Berlin/en/Tutorial:_Using_the_For_Loop_from_the_Parallel_Programming_Library.
-
-
напиши "class function &For" без & и всё поймёшь.
-
Extended Identifiers
You might encounter identifiers (e.g. types, or methods in a class) having the same name as a Delphi language keyword. For example, a class might have a method called begin. Another example is the CLR class called Type, in the System namespace. Type is a Delphi language keyword, and cannot be used for an identifier name.
If you qualify the identifier with its full namespace specification, then there is no problem. For example, to use the Type class, you must use its fully qualified name:
var TMyType : System.Type; // Using fully qualified namespace // avoides ambiguity with Delphi language keyword.
As a shorter alternative, the ampersand (&) operator can be used to resolve ambiguities between identifiers and Delphi language keywords. If you encounter a method or type that is the same name as a Delphi keyword, you can omit the namespace specification if you prefix the identifier name with an ampersand. For example, the following code uses the ampersand to disambiguate the CLR Type class from the Delphi keyword type
var TMyType : &Type; // Prefix with "&" is ok.
-
Спасибо. Не знал
|