[Issue 8772] DList.remove doesn't work with result of std.range.take

2014-04-07 Thread d-bugmail
https://d.puremagic.com/issues/show_bug.cgi?id=8772


monarchdo...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||monarchdo...@gmail.com
 Resolution||INVALID


--- Comment #3 from monarchdo...@gmail.com 2014-04-07 07:49:12 PDT ---
This is invalid, as "remove" is a "O(1)" operation, but removing a Take!Range
is linear operation. So that's an invalid argument.

The correct way to remove a Take!Range, is to use the linear removal function:
linearRemove:

//
import std.range, std.algorithm, std.container;

void main()
{
auto list = DList!int([1,2,3,4,5]);
list.linearRemove(list[].find(3).take(1));
}
//

Well, that's how it is right now anyways. If/when DList will have deterministic
ownership of its elements, things could change, since it would have to call
destructor on the removed elements...

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8772] DList.remove doesn't work with result of std.range.take

2012-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8772


Jonathan M Davis  changed:

   What|Removed |Added

 CC||jmdavisp...@gmx.com


--- Comment #2 from Jonathan M Davis  2012-10-06 22:38:46 
PDT ---
Actually, _all_ of the take* functions should work - take, takeExactly,
takeOne, takeNone - but I think that take is pretty much the only one that
works right now, and not all of the functions which should accept it do (hence
the bug report).

Andrei recently expressed the desire to standardize on wrapper ranges providing
access to what the range that they're wrapping when appropriate (though it's
not always appropriate) via a member variable called source (which Take has),
which may or may not make implementing the changes to std.container simpler and
may or may not make it possible for the std.container functions to operate on
more range types than those returned by take*. But the take* family should
definitely all work or std.container is crippled with regards to any of its
member functions which takes a range from the container.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 8772] DList.remove doesn't work with result of std.range.take

2012-10-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8772



--- Comment #1 from callumena...@gmail.com 2012-10-06 22:22:11 PDT ---
The same also is true for the insert functions.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---