Why is string.front dchar?

Meta jared771 at gmail.com
Mon Jan 13 19:22:42 PST 2014


On Tuesday, 14 January 2014 at 03:01:53 UTC, Jonathan M Davis 
wrote:
> On Monday, January 13, 2014 23:10:03 TheFlyingFiddle wrote:
>> I'm curious, why is the .front property of narrow strings of 
>> type
>> dchar?
>> And not the underlying character type for the string.
>
> It's to promote the correct handling of Unicode. A couple of 
> related questions
> and answers:
>
> http://stackoverflow.com/questions/12288465/std-algorithm-joinerstring-string-why-result-elements-are-dchar-and-not-ch
>
> http://stackoverflow.com/questions/16590650/how-to-read-a-string-character-by-character-as-a-range-in-d
>
> - Jonathan M Davis

Also somewhat related:

http://stackoverflow.com/questions/13368728/why-isnt-dchar-the-standard-character-type-in-d


More information about the Digitalmars-d-learn mailing list