In article <11**********************@l41g2000cwc.googlegroups .com>,
ru*******@hotmail.com wrote:
If you already have an iterator to the element, there is no point in
I do not already have an iterator to the element. I know my example
seems to indicate I do, but the actualy case is much to complicated to
post here. Plus it's irrelevent to my question:
Why would map::insert take a hint but not map::find?
Perhaps we didn't think of it. Or perhaps it is too easy to do
something like:
if (guess->first != key)
guess == m.find(key);
// guess now points to either key or end()
A key question is: For the semantics you desire, can it be done more
efficiently internal to map than you can do externally? Or is such an
external implementation sufficiently complicated that it is likely that
clients will get it wrong? If the answer is no, then adding such
functionality would merely be a convenience function and bloat the
interface with dubious benefit (see std::string). If the answer is yes,
then you likely have a good point, and I would like to see a proposal
before the LWG immediately (time grows short for C++0X).
The "insert with hint" functionality as currently specified is also of
dubious usefulness, and I hope to make it more useful for C++0X. There
will be a paper in the post-Lillehammer mailing addressing this issue.
-Howard