bsl::set::insert

Move-insert value near hint if an equivalent key is not present.

Description

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).

Return Value

iterator to the existing or newly inserted element

Parameters

NameDescription
hintiterator hint for insertion position
valuekey to move-insert