standard ranges

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Wed Jun 27 06:58:46 PDT 2012


On Wed, Jun 27, 2012 at 5:38 PM, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 06/27/2012 03:25 PM, Gor Gyolchanyan wrote:
>
>> Are there functions, which wrap arbitrary range types into standard
>> range interfaces?
>> I looked at the docs, but couldn't find anything.
>> Use case:
>>
>> RandomAccessRange!dchar s = ???("Hello, world!");
>>
>> --
>> Bye,
>> Gor Gyolchanyan.
>>
>
> A narrow string is not a RandomAccessRange.
>
> RandomAccessFinite!(immutable(**dchar)) s = inputRangeObject("Hello,
> world!"d);
>

I tested it out and the string literal without qualifiers counts as a
dstring.

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


More information about the Digitalmars-d mailing list