Auto-invariance (WAS: const )

Sean Kelly sean at invisibleduck.org
Fri Mar 28 15:29:36 PDT 2008


== Quote from Janice Caron (caron800 at googlemail.com)'s article
> On 28/03/2008, Janice Caron <caron800 at googlemail.com> wrote:
> > Yep, that's what we solved. :-)
> Ooh - actually, no. I stand corrected. You're returning a size_t. In
> that case, please ignore my previous post.
> Your template works just fine. Why don't you like it?

Because to get the compiler optimizations specific to invariant I'd
have to create a duplicate that varies only in its acceptance of an
"invariant(char)[] buf" rather than an "in char[] buf".  Such duplication
is pointless if the code is identical in each case.


Sean



More information about the Digitalmars-d mailing list