On Tuesday, 4 September 2018 at 08:17:14 UTC, Andrea Fontana
wrote:
Waiting for this to be merged:
https://github.com/dlang/dmd/pull/8437
Well, it seems Andrei has already approved the concept. well,
THAT is a good reason to avoid this paradigm. Thanks for the info.
On Tuesday, 4 September 2018 at 07:06:43 UTC, Dukc wrote:
On Monday, 3 September 2018 at 13:34:36 UTC, Andrea Fontana
wrote:
On Friday, 31 August 2018 at 09:59:20 UTC, Dukc wrote:
For me, it seems that for generality you should always add
ref into foreach loop variable. The reason is this:
On
On Monday, 3 September 2018 at 13:34:36 UTC, Andrea Fontana wrote:
On Friday, 31 August 2018 at 09:59:20 UTC, Dukc wrote:
For me, it seems that for generality you should always add ref
into foreach loop variable. The reason is this:
One good reason:
https://forum.dlang.org/thread/dlhrrgvzmhlad
On Friday, 31 August 2018 at 09:59:20 UTC, Dukc wrote:
For me, it seems that for generality you should always add ref
into foreach loop variable. The reason is this:
One good reason:
https://forum.dlang.org/thread/dlhrrgvzmhladnphi...@forum.dlang.org
On Friday, 31 August 2018 at 12:52:17 UTC, bauss wrote:
In reality you're micro-optimizing something that doesn't
require it.
I think you misunderstood. I wasn't trying to optimize, I was
looking for a general way to iterate.
I can't see the benefit other than added complexity.
I just exp
On Friday, 31 August 2018 at 12:52:17 UTC, bauss wrote:
So basically ... Instead of copying the value, you're just
copying the address.
I can't see the benefit other than added complexity.
I assume a benefit could be observed if you are copying a large
struct instead of an int.
On Friday, 31 August 2018 at 09:59:20 UTC, Dukc wrote:
For me, it seems that for generality you should always add ref
into foreach loop variable. The reason is this:
import std.experimental.all;
struct NoCopies
{ @disable this(this);
int payload;
}
void main()
{ auto range = new NoCop
For me, it seems that for generality you should always add ref
into foreach loop variable. The reason is this:
import std.experimental.all;
struct NoCopies
{ @disable this(this);
int payload;
}
void main()
{ auto range = new NoCopies[20];
foreach(const ref el; range) el.payload.wri