std.string and std.algorithm: what to do?

Walter Bright newshound1 at digitalmars.com
Thu May 14 13:51:27 PDT 2009


Steven Schveighoffer wrote:
> I could never understand the mentality of returning -1 versus end of 
> string.

It's not -1, it's uint.max. The reason for returning that value is that 
it is the only integer value that can never be a valid index.



More information about the Digitalmars-d mailing list