https://issues.dlang.org/show_bug.cgi?id=14598
Issue ID: 14598
Summary: range primitives for popFront+return front
Product: D
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
It is a constant nuisance that a trivial combined range operation is missing
from std.range as a convenient function.
In many situations this requires pretty verbose code.
if (someCondition)
{
auto val = range.front;
range.popFront;
return val;
}
As such an operation would be used very often it seems reasonable to add them,
even though they are trivial.
I'd suggest frontPop and backPop as names.
--