So why doesn't popFront return an element?

Jesse Phillips jessekphillips+D at gmail.com
Wed Apr 13 16:17:37 PDT 2011


Andrej Mitrovic Wrote:

> Isn't it wasteful to have to call both popFront() and front() to simultaneously remove an element from a range and return it? I mean it's an extra function call, right?

Isn't also a waste to return something that isn't going to be used? There are times it is important to just advance and either skip it or use the value in another location.

In either situation I think the overhead is minimal.


More information about the Digitalmars-d-learn mailing list