Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

D233 and emplace_hint

1 view
Skip to first unread message

Joaquín M López Muñoz

unread,
Dec 21, 2009, 1:00:38 PM12/21/09
to
Starting with D233 (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-
defects.html#233 ),
hinted insertion is more strictly specified than in C++03 so that the
hint can't be ignored and instead it designates very clearly where the
insertion (if it happens) will be done.

But emplace_hint does not follow suit, the note associated to
"a.emplace_hint(p, args)" in the latest C++0x draft (N3000) says:

"equivalent to a.emplace(std::forward<Args>(args)...). Return value
is an iterator
pointing to the element with the key equivalent to the newly
inserted element. The
const_iterator p is a hint pointing to where the search should
start.
Implementations are permitted to ignore the hint."

Is this a defect? Shouldn't emplace_hint provide guarantees about
the insertion point just as hinted insert does?

Joaqu�n M L�pez Mu�oz
Telef�nica, Investigaci�n y Desarrollo


--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

0 new messages