Problem with using struct ranges with @disabled this(this) with some range functions
Uranuz via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Sep 1 23:28:51 PDT 2015
As far as I understand to save current cursor of forward range I
should always use *save* property. But sometimes range struct is
just copied using postblit without using save (it happens even in
Phobos). Is it correct behaviour to *pass ownership* for range
structs via just copying of range or not. As I think for at least
*forward* ranges that are structs we must always use save methot
to store new cursor. But for *input* ranges it is not possible,
so there maybe plain copying could be allowed. I thing that we
should work out some descision on this problem, provide some
unittests for different types of ranges with and without postblit
for standard Phobos functions and fix them accordingly.
I have problem with std.range.take function and forward range
with disabled postblit and I don't understand is it my or library
bug?
More information about the Digitalmars-d-learn
mailing list