Copying and in-place methods [was: Why is array truth tied to .ptr?]

Leandro Lucarella llucax at gmail.com
Wed Dec 12 06:27:45 PST 2007


Robert DaSilva, el 11 de diciembre a las 21:31 me escribiste:
> > Ok, good catch, maybe that syntax is not right but you missed the big
> > picture (a compiler generated default implementation for a copying
> > function that can be overrideable).
> > 
> > If you now write t.sort.dup(), you are exactly doing that: duplicating t
> > and then sorting it (in-place I guess). If the implementor has a more
> > eficient way to use the copy while sorting, you miss that, or you have to
> > change the syntax (to t.dupsort() for example).
> > 
> 
> I'm just saying that t.sort.dup() can *only* mean sort t then duplicate
> what sort returns (an error as sort returns void); unless sort is a
> struck that overloads opCall, but it's not.

I was talking about a new feature proposal. I know it doesn't work now.

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
Hey you, dont help them to bury the light
Don't give in without a fight.



More information about the Digitalmars-d mailing list