Calls to struct methods and immutable

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Tue Nov 27 06:05:29 PST 2012


On 11/27/2012 01:16 PM, Joseph Rushton Wakeling wrote:
>        immutable(Node) idup() pure const @property
>        {
>              auto linkCopy = to!(Link[])(links);
>              immutable ilinks = assumeUnique(linkCopy);
>              return immutable(Node)(id, ilinks);
>        }

Actually I'm being overly complicated here as with dynamic arrays I can simply do,

         immutable(Node) idup() pure const @property
         {
               return immutable(Node)(id, links.idup);
         }

... so the real issue here seems to be that there's no canonical way (that I can 
find) to idup an _associative_ array.


More information about the Digitalmars-d-learn mailing list