How to return range constructs?

Robin robbepop at web.de
Fri Feb 28 15:06:23 PST 2014


Hiho,

sorry for the double post but I can't find an edit button.

I have managed to write a custom ForwardRange based on your code 
as I wished it to behave. However, the assertion fails on 
compilation, now. The only thing I have changed is that I have 
added a constructor as well as changing the type of T[] to 
Matrix!T pointer type.

The general layout stayed the same and I don't think that a 
constructor may break the ForwardRange interface.

Do you know what's wrong here?

Here is the code:
http://dpaste.dzfl.pl/8718b09cb825

Besides that ... are there nicer workarounds to prevent using 
matrix by value instead of storing it as a pointer which is kind 
of unsafe?

Thanks in advance!

Robin


More information about the Digitalmars-d-learn mailing list