Topic: D233 and emplace_hint


Author: =?ISO-8859-1?Q?Joaqu=EDn_M_L=F3pez_Mu=F1oz?= <joaquin@tid.es>
Date: Mon, 21 Dec 2009 12:00:38 CST
Raw View
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-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]