Operator overloading -- lets collect some use cases
Jarrett Billingsley
jarrett.billingsley at gmail.com
Sun Dec 28 13:20:05 PST 2008
On Sun, Dec 28, 2008 at 4:17 PM, Jarrett Billingsley
<jarrett.billingsley at gmail.com> wrote:
> On Sun, Dec 28, 2008 at 11:50 AM, Don <nospam at nospam.com> wrote:
>
>> So, please post any use cases which you consider convincing.
>
> Virtually all I use it for is making containers. I do almost no
> numerical programming. I would probably not miss much if all I could
> overload were opIndex[Assign], opSlice[Assign], opCat[Assign], and
> opApply.
I also want to add that even these could be improved. How many times
have I wanted this:
dest[lo1 .. hi1] = src[lo2 .. hi2];
to be a single operation? You can't do it. You're forced to create a
stupid temporary in the opSlice of src, and then copy out of that into
dest's opSliceAssign.
More information about the Digitalmars-d
mailing list