On Saturday, 9 December 2017 at 19:26:26 UTC, David Nadlinger
wrote:
but "free" references don't exist in the language.
To the point! Thanks!
On Saturday, 9 December 2017 at 06:46:27 UTC, Arun Chandrasekaran
wrote:
On Saturday, 9 December 2017 at 06:38:46 UTC, anonymous wrote:
On Saturday, 9 December 2017 at 06:15:16 UTC, Arun
Chandrasekaran wrote:
Is there a way to get the pointer or reference of an element
in Array(T)?
[...]
On Saturday, 9 December 2017 at 06:46:27 UTC, Arun Chandrasekaran
wrote:
Thanks. Just curious why reference can't be obtained here.
Saves nasty null checks in most places.
D simply doesn't have a (C++-style) concept of references as part
of the type. Arguments can be passed by reference - henc
On Saturday, 9 December 2017 at 06:38:46 UTC, anonymous wrote:
On Saturday, 9 December 2017 at 06:15:16 UTC, Arun
Chandrasekaran wrote:
Is there a way to get the pointer or reference of an element
in Array(T)?
[...]
auto d2 = gallery[0];
auto d2 = &gallery[0];
Thanks. Just curious why
On Saturday, 9 December 2017 at 06:15:16 UTC, Arun Chandrasekaran
wrote:
Is there a way to get the pointer or reference of an element in
Array(T)?
[...]
auto d2 = gallery[0];
auto d2 = &gallery[0];
Is there a way to get the pointer or reference of an element in
Array(T)?
https://run.dlang.io/gist/70fd499afe8438d4877f57aec90c3091?compiler=dmd
The assertion seems to fail below. Value copy is not is intended
here.
module test;
void main()
{
struct Data
{
int id;
}