Re: Understand typeof trick

2015-12-25 Thread anonymous via Digitalmars-d-learn
On 25.12.2015 13:10, Joakim Brännström wrote: In http://forum.dlang.org/post/ojawnpggfaxevqpmr...@forum.dlang.org Adam uses findSkip as an example and especially points out the "D idiom with is/typeof". I'm not quite sure I understand it correctly. Please correct me if I have misunderstood

Re: Understand typeof trick

2015-12-25 Thread Adam D. Ruppe via Digitalmars-d-learn
Well, what I'd really want to document here's isn't necessarily the nitty-gritty of the idiom and why it is used (that's a thing for api authors, but these docs are targeted at api consumers), but more just what it actually means at a glance. That line of code simply means "pred must be a

Understand typeof trick

2015-12-25 Thread Joakim Brännström via Digitalmars-d-learn
Hello, In http://forum.dlang.org/post/ojawnpggfaxevqpmr...@forum.dlang.org Adam uses findSkip as an example and especially points out the "D idiom with is/typeof". I'm not quite sure I understand it correctly. Please correct me if I have misunderstood anything regarding the idiom.

Re: Understand typeof trick

2015-12-25 Thread Joakim Brännström via Digitalmars-d-learn
On Friday, 25 December 2015 at 14:55:04 UTC, anonymous wrote: On 25.12.2015 13:10, Joakim Brännström wrote: [B] Evaluates to the function type "constructed" by binaryFun. Almost. It evaluates to the type of the expression. The expression is a function call, so typeof evaluates to the return