cloning arrays

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 11 23:56:26 PDT 2016


On Sat, 2016-09-10 at 15:54 -0700, Jonathan M Davis via Digitalmars-d-
learn wrote:
> […]
> 
> dup creates an array with mutable elements that are copies of what
> was in
> the original array. How deep a copy that is depends on the type. It
> does
> exactly as deep a copy as simply copying the element would do. e.g.
> 
> […]

Which raises the question of whether:

	x[]

and

	x.dup
 
have the same result.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20160912/13cda20d/attachment.sig>


More information about the Digitalmars-d-learn mailing list