[TDPL] function type syntax

Philippe Sigaud philippe.sigaud at gmail.com
Wed Feb 17 14:54:32 PST 2010


I was browsing the TDPL chapter on concurrency, when I found this signature:

void setMaxMailboxSize(Tid tid, size_t messages, bool(Tid) onCrowdingDoThis);

(in the "Mailbox Crowding" subsection)

I'm interested by onCrowdingDoThis type: bool(Tid), as it's the first time I see such a syntax: T(U) t

It seemed quite natural to consider it a function/delegate/callable taking a Tid and returning a bool, and that's indeed what's implied by the text.

It doesn't work with DMD 2.040, so I was just curious: new feature, simplified code to avoid clutter in the book, bug, or Easter egg?


Philippe







More information about the Digitalmars-d mailing list