standard ranges

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Wed Jun 27 08:47:41 PDT 2012


On Wed, Jun 27, 2012 at 7:41 PM, Jonathan M Davis <jmdavisProg at gmx.com>wrote:

> On Wednesday, June 27, 2012 17:58:46 Gor Gyolchanyan wrote:
> > I tested it out and the string literal without qualifiers counts as a
> > dstring.
>
> That depends entirely on what you assign it to.
> writeln(typeof("hello").stringof) prints string, not dstring. So, the
> literal
> by itself is a string by default.
>
> - Jonathan M Davis
>

this is weird. I wrote a function, which transforms anything, which
qualifies as isForwardRange into an implementation of ForwardRange. And the
type inference of that function produced a ForwardRangeImpl!dchar when I
passed it a string literal.

Although string and wstring also qualify as a forward range.

-- 
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120627/4fa27328/attachment-0001.html>


More information about the Digitalmars-d mailing list