Re: Reason for 'static struct'

2015-12-10 Thread Daniel Kozak via Digitalmars-d-learn
Yes, exactly. Some people even use static if it is not needed because it is harmless. And remove it only when enclosing context is demand. Dne 9. 12. 2015 22:40 napsal uživatel "Jon D via Digitalmars-d-learn" < digitalmars-d-learn@puremagic.com>: > On Wednesday, 9 December 2015 at 21:23:03 UTC,

Re: Reason for 'static struct'

2015-12-09 Thread Jon D via Digitalmars-d-learn
On Wednesday, 9 December 2015 at 21:23:03 UTC, Daniel Kozák wrote: V Wed, 09 Dec 2015 21:10:43 + Jon D via Digitalmars-d-learn napsáno: There is a fair bit of range related code in the standard library structured like: auto MyRange(Range)(Range

Reason for 'static struct'

2015-12-09 Thread Jon D via Digitalmars-d-learn
There is a fair bit of range related code in the standard library structured like: auto MyRange(Range)(Range r) if (isInputRange!Range) { static struct Result { private Range source; // define empty, front, popFront, etc }

Re: Reason for 'static struct'

2015-12-09 Thread Daniel Kozák via Digitalmars-d-learn
V Wed, 09 Dec 2015 21:10:43 + Jon D via Digitalmars-d-learn napsáno: > There is a fair bit of range related code in the standard library > structured like: > > auto MyRange(Range)(Range r) > if (isInputRange!Range) > { >