Passing shared delegates
Martin Drasar
drasar at ics.muni.cz
Mon Jan 14 02:13:01 PST 2013
On 14.1.2013 8:56, Maxim Fomin wrote:
> Which compiler version do you use? It compiles on 2.061.
It was 2.060. It compiles now on 2.061. Great!
> In case of applying attributes to functions, mostly it is irrelevant
> whether it stands first or last. So,
>
> void foo() shared {}
>
> and
>
> shared void foo() {}
>
> in A class are equivalent. However in case of bar parameter you are
> qualifying not a function, but object, so shared before return type of
> delegate applies to object, like (shared (int i)). Shared after delegate
> applies to delegate type, not object itself.
Thanks for clarification.
Martin
More information about the Digitalmars-d-learn
mailing list