On Monday, 27 June 2016 at 06:31:49 UTC, Ola Fosheim Grøstad
Besides there are plenty of other advantages to using a
terminating sentinel depending on the use scenario. E.g. if you
want many versions of the same tail or if you are splitting a
string at white space (overwrite a white space char with a
This strlen2 doesn't require special alignment or casting of char
pointer types to some larger type. That keeps the strlen2
implementation fairly simple.
The implementation is only testing one char per increment. It
doesn't require the extra xor processing used in some of the
I haven't checked if there is a strlen for dchar or wchar, but it
should also speed up those.