Linked list as a bidirectional range? I have some questions...

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 14 04:27:42 PDT 2014


On Wednesday, 13 August 2014 at 19:30:53 UTC, H. S. Teoh via 
Digitalmars-d-learn wrote:
> On Wed, Aug 13, 2014 at 07:23:30PM +0000, via 
> Digitalmars-d-learn wrote:
>> On Wednesday, 13 August 2014 at 18:58:59 UTC, H. S. Teoh via
>> Digitalmars-d-learn wrote:
>> >On Wed, Aug 13, 2014 at 06:31:32PM +0000, Gary Willoughby via
>> >Digitalmars-d-learn wrote:
> [...]
>> >>I've used your advice and implemented a range over the list 
>> >>as
>> >>suggested, the problem being i cannot get it to pass the
>> >>isForwardRange check.
>> >>
>> >>Code: http://dpaste.dzfl.pl/cad89406bbcc#line-220
>> >>
>> >>You'll notice the assert on line 220 fails. Any idea what 
>> >>i'm doing
>> >>wrong?
>> >
>> >You need to put @property on .save.
>> 
>> Hmm...
>> 
>>     struct Result {
>>         public @property auto save1() {
>>             return this;
>>         }
>>         public auto save2() {
>>             return this;
>>         }
>>     }
>> 
>>     pragma(msg, typeof(Result.init.save1));
>>     pragma(msg, typeof(Result.init.save2));
>> 
>> This outputs:
>> 
>>     Result
>>     Result()
>> 
>> `Result()` looks bogus.
>
> File a bug. :-)
>
> 	https://issues.dlang.org/enter_bug.cgi

https://issues.dlang.org/show_bug.cgi?id=13293

And I see that Vladimir already reported a bug about the original 
problem:
https://issues.dlang.org/show_bug.cgi?id=11761


More information about the Digitalmars-d-learn mailing list