On Wednesday, July 04, 2012 12:55:44 Tobias Pankrath wrote: > > Many languages does this (it doesn't mean it is the right thing > > to do). Do you know why this shouldn't be done ? > > In C++ it was exception safety, wasn't it?
I believe that it was purely a question of speed. If popFront returns an element, then that element gets copied, and if you didn't need to access the element, then that's wasted cycles. You have to worry about exceptions in either case, depending on the what popFront is doing. - Jonathan M Davis