DConf2016 Livestream questions
Jack Stouffer via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 4 10:32:07 PDT 2016
On Wednesday, 4 May 2016 at 17:23:01 UTC, Steven Schveighoffer
wrote:
> So this really isn't something that's super-important to solve.
> Do you have a specific use case?
>
> -Steve
Well, in most cases the length function should be marked const
because it usually doesn't modify the struct in any way. But this
isn't possible if you have a composed range because you don't
know if the data/range underneath has a const length. This also
applies to the front function in a lot of cases. And because of
these two cases I think adding const to a lot of the member
functions could result in slightly better code-gen.
More information about the Digitalmars-d
mailing list