opMul

Dave Dave_member at pathlink.com
Sat Mar 8 10:16:42 PST 2008


"Janice Caron" <caron800 at googlemail.com> wrote in message 
news:mailman.113.1204800234.2351.digitalmars-d at puremagic.com...
> On 06/03/2008, Koroskin Denis <2korden+dmd at gmail.com> wrote:
>> This syntax looks less confusing to me. Why keep both?
>
>    class A
>    {
>        const(this)
>        {
>            A opAdd(A a) {...}
>            A opSub(A a) {...}
>            A opMul(A a) {...}
>            A opDiv(A a) {...}
>        }
>    }
>
> ? And for single functions
>
>    const(this) T f()
>
> is a lot less confusing than
>
>    const T f()
>
> as the former tells me explicitly that "this" is the thing that is
> const, wheras the latter makes it look like "T" is const (which it
> isn't).

Offhand, that sounds like a great solution to me...

Janice, why has it been "shot down" in the past?

Thanks,

- Dave




More information about the Digitalmars-d mailing list