standard ranges

Timon Gehr timon.gehr at gmx.ch
Wed Jun 27 10:32:48 PDT 2012


On 06/27/2012 05:54 PM, Gor Gyolchanyan wrote:
> On Wed, Jun 27, 2012 at 7:49 PM, Jonathan M Davis <jmdavisProg at gmx.com
> <mailto:jmdavisProg at gmx.com>> wrote:
>
>     _All_ strings are considered to be ranges of dchar. That's why
>     string and
>     wstring are not random access ranges and hasLength is false for them.
>
>     - Jonathan M Davis
>
>
> So why is the type of a string literal _string_ by default?

Because it is a _string_ literal. If you are asking why utf-8 is the
default, that is because it is the most space efficient, backwards-
compatible to ASCII, and because random access to a string is rarely
required.


? Isn't it confusing when dealing with ranges?
>
> --
> Bye,
> Gor Gyolchanyan.

Why would it be?


More information about the Digitalmars-d mailing list