Relaxing the definition of isSomeString and isNarrowString

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Sun Aug 24 06:21:24 PDT 2014


24-Aug-2014 05:06, Andrei Alexandrescu пишет:
> Currently char[], wchar[], dchar[] and qualified variants fulfill the
> requirements of isSomeString. Also, char[], wchar[] and qualified
> variants fulfill the requirements of isNarrowString.
>
> Various algorithms in Phobos test for these traits to optimize away UTF
> decoding where unnecessary.
>
> I'm thinking of relaxing the definitions to all types that fulfill the
> following requirements:
>
> * are random access ranges
> * element type is some character
> * offer .ptr as a @system property that offers a pointer to the first
> character
>

.ptr would be nice '@system' addition to any contiguous ranges.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list