popFrontExactly?

Jonathan M Davis jmdavisProg at gmx.com
Thu Nov 22 03:39:58 PST 2012


On Sunday, November 18, 2012 21:34:37 monarch_dodra wrote:
> Should I push a pull request adding such a function (and its
> friends) to phobos? How does the group feel about such functions?

In principle, it's a good idea, but I also worry about a proliferation of such 
functions. Personally, I think that I would have argued for popFrontN being 
popFrontExactly in the first place, but it's obviously too late for that. In 
probably all cases that I use popFrontN, what I'd want would be 
popFrontExactly (though popFrontNExactly would probably be a better name given 
its connection to popFrontN).

So, you probably should create a pull request for it, but then you need 
popBackNExactly too, and possibly drop(Front)Exactly and dropBackExactly, and 
that's where things get a bit ugly. But given the concerns for efficiency and 
the prevalence of functions like popFrontN in range based code, 
popFrontNExactly would make good sense.

- Jonathan M Davis


More information about the Digitalmars-d mailing list