On 9/13/16 5:01 PM, Yuxuan Shui wrote:
For example, a common use case might be I want to capture everything by
value. In stead of adding all the fields by hand and passing them to the
constructor, I want the compiler to do it for me.
i.e. I wish I could (borrowing C++ syntax):
struct A[=] {
On Tuesday, 13 September 2016 at 20:36:22 UTC, Steven
Schveighoffer wrote:
On 9/13/16 4:11 PM, Yuxuan Shui wrote:
On Tuesday, 13 September 2016 at 20:00:40 UTC, Steven
Schveighoffer wrote:
Not familiar with C++ lambda. You can always "specify" how to
capture
the data by directly declaring it:
On 9/13/16 4:11 PM, Yuxuan Shui wrote:
On Tuesday, 13 September 2016 at 20:00:40 UTC, Steven Schveighoffer wrote:
Not familiar with C++ lambda. You can always "specify" how to capture
the data by directly declaring it:
auto foo()
{
int x;
static struct S
{
int x;
}
r
On Tuesday, 13 September 2016 at 20:00:40 UTC, Steven
Schveighoffer wrote:
On 9/13/16 3:42 PM, Yuxuan Shui wrote:
[...]
There's nothing in the language to prevent this optimization.
[...]
Again, could be clearer. But the fact that both the function
and the struct affect the same data kind
On Tuesday, 13 September 2016 at 01:32:19 UTC, Steven
Schveighoffer wrote:
On 9/12/16 4:11 PM, Ali Çehreli wrote:
On 09/10/2016 10:44 PM, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by
reference
(which, BTW, is not mentioned at all here:
https://dlang.org/spec/struc
On 9/13/16 3:42 PM, Yuxuan Shui wrote:
On Tuesday, 13 September 2016 at 01:32:19 UTC, Steven Schveighoffer wrote:
On 9/12/16 4:11 PM, Ali Çehreli wrote:
On 09/10/2016 10:44 PM, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by reference
(which, BTW, is not mentioned at
On Tuesday, 13 September 2016 at 01:32:19 UTC, Steven
Schveighoffer wrote:
On 9/12/16 4:11 PM, Ali Çehreli wrote:
On 09/10/2016 10:44 PM, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by
reference
(which, BTW, is not mentioned at all here:
https://dlang.org/spec/struc
On 9/12/16 4:11 PM, Ali Çehreli wrote:
On 09/10/2016 10:44 PM, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by reference
(which, BTW, is not mentioned at all here:
https://dlang.org/spec/struct.html#nested).
" It has access to the context of its enclosing scope (via
On 09/10/2016 10:44 PM, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by reference
(which, BTW, is not mentioned at all here:
https://dlang.org/spec/struct.html#nested). And bliting a struct
obviously doesn't do a deep copy of its context.
So my question is, is there a
On Sunday, 11 September 2016 at 05:44:13 UTC, Yuxuan Shui wrote:
I recently noticed nested struct capture its context by
reference (which, BTW, is not mentioned at all here:
https://dlang.org/spec/struct.html#nested). And bliting a
struct obviously doesn't do a deep copy of its context.
So my
I recently noticed nested struct capture its context by reference
(which, BTW, is not mentioned at all here:
https://dlang.org/spec/struct.html#nested). And bliting a struct
obviously doesn't do a deep copy of its context.
So my question is, is there a way to deep copy the context of a
struct
11 matches
Mail list logo