
on Sat Jul 25 2009, Thorsten Ottosen <thorsten.ottosen-AT-dezide.com> wrote:
David Abrahams skrev:
on Fri Jul 24 2009, Thorsten Ottosen <thorsten.ottosen-AT-dezide.com> wrote:
David Abrahams skrev:
Regardless, there could still be a single correct answer from the standpoint of aesthetics, purity, and orthogonality. If
drop_front(find(range, x))
does the same thing as
find[_f+1,_e]( range, x )
then you don't need the complicated meta-goop in there.
So how do we evaluate that aesthetics, purity and orthogonality of the two different approaches?
Lots of hard thinking.
The find interface is one interface with goop, and the other alternative is now at least 5 different functions: find, until, before, drop_front, drop_back.
No, that's not a fair assessment. drop_front and drop_back are useful on their own and in fact I think Andrei is already calling them pop_front and pop_back(?) So we're left with "find, until, and before." What's "before?"
Then how would you safely implement
find[_f-1,_e]( range, x );
At first glance, you can't. Is there a known use case for that? If not, it's moot.
Who knows. Maybe you want the element before the found one to be there for some reason.
"Maybe, for some reason" arguments don't hold much water with me, especially in a library design context. -- Dave Abrahams BoostPro Computing http://www.boostpro.com