Why map return [] ?

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 14 08:49:00 PDT 2017


On Friday, 14 April 2017 at 15:38:19 UTC, Suliman wrote:
> On Friday, 14 April 2017 at 15:35:15 UTC, cym13 wrote:
>> On Friday, 14 April 2017 at 15:29:33 UTC, Suliman wrote:
>>> auto x = MySQLTablesRange.map!(a=>a);
>>> writeln(x);
>>>
>>> return: []
>>>
>>> while next code:
>>> MySQLTablesRange.each!(a=>a.writeln);
>>>
>>> return data line by line.
>>>
>>> Why?
>>
>> What library is that supposed to be?
>
> http://code.dlang.org/packages/mysql-native

I found problem! ResultRange should be converted to array before 
it can be `map`ed


More information about the Digitalmars-d-learn mailing list