Our Sister
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 26 12:57:20 PDT 2016
On Thursday, May 26, 2016 17:50:36 Adam D. Ruppe via Digitalmars-d wrote:
> Would an RCStr pass isSomeString? I kinda think it shouldn't.
> Actually, isSomeString probably shouldn't often be used - instead
> checking for string-like range capabilities is likely better for
> algorithms. Then doing some_algorithm(my_rcstr) fails - you must
> do some_algorithm(my_rcstr.some_range)
RCStr definitely should _not_ pass isSomeString. Those traits specifically
work only for the built-in types and not for stuff that acts like them. It's
a disaster waiting to happen otherwise. We need to distinguish between
testing for something that is a string and something that acts like one.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list