Re: this r-value optimizations

2017-08-01 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 1 August 2017 at 22:47:24 UTC, Nordlöw wrote: Given the `struct S` with lots of data fields, I've written the following functional way of initializing only a subset of the members in an instance of `S`: struct S { [...] } Now the question becomes: will the S-copying inside `wi

this r-value optimizations

2017-08-01 Thread Nordlöw via Digitalmars-d-learn
Given the `struct S` with lots of data fields, I've written the following functional way of initializing only a subset of the members in an instance of `S`: struct S { int i; float f; ... this(int i) { this.i = i; } S withF(float f) { // will this be optimized