Move-insert value near hint if an equivalent key is not present.
Declared in <bslstl_set.h>
set<KEY, COMPARATOR, ALLOCATOR>::iterator
insert(
const_iterator hint,
BloombergLP::bslmf::MovableRef<value_type> value);
Insert in amortized constant time if hint is a valid immediate successor to value; otherwise this method has no effect. value is left in a valid but unspecified state. Return an iterator referring to the (possibly newly inserted) value_type object in this set that is equivalent to value. If hint is not a valid immediate successor to value, this operation has O[log(N)] complexity, where N is the size of this set. This method requires that the (template parameter) type KEY be move-insertable (see {Requirements on KEY}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).
iterator to the existing or newly inserted element
| Name | Description |
|---|---|
| hint | iterator hint for insertion position |
| value | key to move-insert |