Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I suggest just reading what the compiler reads: the header file for <code>#include &lt;set&gt;</code>. On my system (GNU libstdc++ 4.5.1) I can read the following self-explanatory text:</p> <pre><code> /** * @brief Attempts to insert an element into the %set. * @param position An iterator that serves as a hint as to where the * element should be inserted. * @param x Element to be inserted. * @return An iterator that points to the element with key of @a x (may * or may not be the element passed in). * * This function is not concerned about whether the insertion took place, * and thus does not return a boolean like the single-argument insert() * does. Note that the first parameter is only a hint and can * potentially improve the performance of the insertion process. A bad * hint would cause no gains in efficiency. * * For more on @a hinting, see: * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html * * Insertion requires logarithmic time (if the hint is not taken). */ iterator insert(iterator __position, const value_type&amp; __x) { return _M_t._M_insert_unique_(__position, __x); } </code></pre> <p>Takeaway: </p> <ol> <li><strong>A bad hint would cause no gains in efficiency</strong></li> <li>Insertion is <code>O(log n)</code></li> <li>You can read even more about <a href="https://web.archive.org/web/20100223102002/http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt07ch17.html" rel="nofollow">insertion hints in the GNU libstdc++ manual</a>.</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload