On Fri, 24 Aug 2012 13:35:57 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
foreach(bool doRemove, item; container)
{
doRemove = predicate(item);
}
Whoops, should be
foreach(ref bool doRemove, item; container)
-Steve
On 08/27/2012 06:27 AM, Steven Schveighoffer wrote:
On Fri, 24 Aug 2012 13:35:57 -0400, Steven Schveighoffer
schvei...@yahoo.com wrote:
foreach(bool doRemove, item; container)
{
doRemove = predicate(item);
}
Whoops, should be
foreach(ref bool doRemove, item; container)
-Steve
Right,
On 08/24/2012 12:23 PM, JN wrote:
I feel kinda stupid here, what's wrong with C++ remove_if (
http://www.cplusplus.com/reference/algorithm/remove_if/ )?
you mean something like
c.erase(remove_if(c.begin(), c.end(), predicate), c.end())
?
That actually is the sort of thing one could
On 08/27/2012 12:46 PM, Ellery Newcomer wrote:
On 08/24/2012 12:23 PM, JN wrote:
I feel kinda stupid here, what's wrong with C++ remove_if (
http://www.cplusplus.com/reference/algorithm/remove_if/ )?
you mean something like
c.erase(remove_if(c.begin(), c.end(), predicate), c.end())
?
That
On Wed, 01 Aug 2012 03:44:47 -0400, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
Hello.
Today I was thinking about Java. Specifically, java.util.Iterator and
the pattern
while(iter.hasNext()) {
Object item = iter.next();
if(predicate(item)) {
I feel kinda stupid here, what's wrong with C++ remove_if (
http://www.cplusplus.com/reference/algorithm/remove_if/ )?
Hello.
Today I was thinking about Java. Specifically, java.util.Iterator and
the pattern
while(iter.hasNext()) {
Object item = iter.next();
if(predicate(item)) {
iter.remove();
}
}
You can do this in Java. Easily. You can also do this in C++ with
On Wednesday, 1 August 2012 at 07:44:49 UTC, Ellery Newcomer
wrote:
I also take (erk) issue with the implementation of
linearRemove. It depends on an interface from the container
range that is not part of the general range interface. This
poses problems. You can't wrap the container range with