Wrapping a forward range in another forward range
Rudy Raab
TransientResponse at outlook.com
Mon Jun 25 13:08:48 UTC 2018
On Sunday, 24 June 2018 at 21:28:06 UTC, aliak wrote:
> On Sunday, 24 June 2018 at 20:33:32 UTC, Rudy Raab wrote:
>> So I have an XLSX (MS Excel 2007+ file format) library that I
>> wrote (https://github.com/TransientResponse/dlang-xlsx) that
>> I recently converted from std.xml to dxml. That went well and
>> it still works (much faster too).
>>
>> [...]
>
> I think it's the isSomeChar!(ElementType!R), not the
> isRandomAccessRange (because string isSomeString and
> !isSomeChar)?
>
> Cheers,
> - Ali
Changing it to isSomeString!(ElementType!R) moves the error to my
empty() function:
```
source\xlsx.d(205,22): Error: template std.range.primitives.empty
cannot deduce function from argument types
!()(XLSheet!(string[])), candidates are:
C:\D\dmd2\windows\bin\..\..\src\phobos\std\range\primitives.d(2090,16): std.range.primitives.empty(T)(auto ref scope const(T) a) if (is(typeof(a.length) : size_t) || isNarrowString!T)
```
I tried implementing a length() function (the number of rows
remaining in the range, which is known at runtime), but the error
remains.
More information about the Digitalmars-d-learn
mailing list