On Monday, 3 December 2018 at 22:04:25 UTC, Neia Neutuladh wrote:
On Mon, 03 Dec 2018 21:27:52 +, faissaloo wrote:
Then shouldn't the following output false, false, true?
An object reference is a pointer value. The pointer values are
copied. The pointed-at objects are not copied.
Furthe
On Mon, 03 Dec 2018 21:27:52 +, faissaloo wrote:
> Then shouldn't the following output false, false, true?
An object reference is a pointer value. The pointer values are copied. The
pointed-at objects are not copied.
Furthermore, the syntax
Object[6] array = new Object();
only allocate
On Monday, 3 December 2018 at 20:37:22 UTC, Jonathan M Davis
wrote:
On Monday, December 3, 2018 1:07:24 PM MST Goksan via
Digitalmars-d-learn wrote:
Are there any differences between these 2 methods of copying
elements?
double[] array = [ 1, 20, 2, 30, 7, 11 ];
// Non dup
double[6] bracket_sy
On Monday, December 3, 2018 1:07:24 PM MST Goksan via Digitalmars-d-learn
wrote:
> Are there any differences between these 2 methods of copying
> elements?
>
> double[] array = [ 1, 20, 2, 30, 7, 11 ];
>
> // Non dup
> double[6] bracket_syntax_dup = array;
> bracket_syntax_dup[] = array;
> bracket
Yes it is. The dup version just make an extra copy of array for no reason.
po 3. 12. 2018 21:10 odesÃlatel Goksan via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> napsal:
> Are there any differences between these 2 methods of copying
> elements?
>
> double[] array = [ 1, 20, 2, 30,
Are there any differences between these 2 methods of copying
elements?
double[] array = [ 1, 20, 2, 30, 7, 11 ];
// Non dup
double[6] bracket_syntax_dup = array;
bracket_syntax_dup[] = array;
bracket_syntax_dup[0] = 50;
// Dup
double[6] normal_dup = array.dup;
normal_dup[0] = 100;
OUTPUT: (ar