Excesive use of opIndex* in std.container.Array (and Ranges in general)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Jul 2 05:52:46 PDT 2012


On 7/2/12 4:13 AM, monarch_dodra wrote:
> When I read the "D programming language" chapter on operator
> overloading, I found that the fact there were operators "opIndexAssign",
> "opIndexOpAssing" and "opIndexUnary" to be nothing short of brilliant.
> Finally, a container of bools that works for real!
>
> However, if and when "opIndex" is capable of returning a reference,
> isn't defining the above symbols gratuitous, error prone, and worse,
> actually restrictive?

I agree. There should be an enhancement request for this.

Andrei



More information about the Digitalmars-d mailing list