|
Boost : |
Subject: Re: [boost] [unordered] unordered_set::erase() complexity bug?
From: John Zwinck (jzwinck_at_[hidden])
Date: 2009-11-29 10:48:43
OvermindDL1 wrote:
> Instead of making a new function name, why not a function overload:
>
> iterator erase(iterator it); // original
> void erase(iterator it, no_return); // no_return is an empty global
> created struct so you can just call m.erase(it, no_return);
Is "m.erase(it, no_return)" better than "m.erase_no_return(it)"?
Is there a precedent (in C++, not Boost) for this, other than the
(IMO confusing) pre- vs. post-increment operator declarations?
I'm also concerned that people who bind C++ with dynamic languages
may end up writing wrappers to make it a unary function again. This
is a special case of the fact that a binary function may be a little
more difficult to integrate into code which uses pointers to member
functions.
I'm open to other opinions, but offhand I prefer a unary function.
John Zwinck
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk