<div class="gmail_quote">On Wed, Jun 27, 2012 at 7:49 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com" target="_blank">jmdavisProg@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Wednesday, June 27, 2012 19:47:41 Gor Gyolchanyan wrote:<br>
> On Wed, Jun 27, 2012 at 7:41 PM, Jonathan M Davis<br>
<<a href="mailto:jmdavisProg@gmx.com">jmdavisProg@gmx.com</a>>wrote:<br>
> > On Wednesday, June 27, 2012 17:58:46 Gor Gyolchanyan wrote:<br>
> > > I tested it out and the string literal without qualifiers counts as a<br>
> > > dstring.<br>
> ><br>
> > That depends entirely on what you assign it to.<br>
> > writeln(typeof("hello").stringof) prints string, not dstring. So, the<br>
> > literal<br>
> > by itself is a string by default.<br>
> ><br>
> > - Jonathan M Davis<br>
><br>
> this is weird. I wrote a function, which transforms anything, which<br>
> qualifies as isForwardRange into an implementation of ForwardRange. And the<br>
> type inference of that function produced a ForwardRangeImpl!dchar when I<br>
> passed it a string literal.<br>
><br>
> Although string and wstring also qualify as a forward range.<br>
<br>
</div></div>_All_ strings are considered to be ranges of dchar. That's why string and<br>
wstring are not random access ranges and hasLength is false for them.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Jonathan M Davis<br>
</font></span></blockquote></div><br>So why is the type of a string literal _string_ by default? Isn't it confusing when dealing with ranges?<br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>