insert overloads
Synopses
Declared in <bslstl_unorderedset.h>
Insert the specified value into this set if a key equivalent to value does not already exist in this set; otherwise, if a key equivalent to value already exists in this set, this method has no effect. value is left in a valid but unspecified state. Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this set that is equivalent to value, and whose second member is true if a new value was inserted, and false if the key was already present. This method requires that the (template parameter) type KEY be move‐insertable into this set (see {Requirements on KEY}).
Insert into this set the value of each value_type object in the specified values initializer list if a key equivalent to the object is not already contained in this set. This method requires that the (template parameter) type KEY be copy‐insertable (see {Requirements on KEY}).
void
insert(std::initializer_list<ManagedAttribute> values);
Insert the specified value into this set if a key equivalent to value does not already exist in this set; otherwise, if a key equivalent to value already exists in this set, this method has no effect. Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this set that is equivalent to value, and whose second member is true if a new value was inserted, and false if the key was already present. This method requires that the (template parameter) type KEY be copy‐insertable (see {Requirements on KEY}).
pair<iterator, bool>
insert(value_type const& value);
Insert the specified value into this set if a key equivalent to value does not already exist in this set; otherwise, if a key equivalent to value already exists in this set, this method has no effect. value is left in a valid but unspecified state. Return a pair whose first member is an iterator referring to the (possibly newly inserted) value_type object in this set that is equivalent to value, and whose second member is true if a new value was inserted, and false if the key was already present.
template<class LOOKUP_KEY>
pair<iterator, bool>
insert(LOOKUP_KEY&& value)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
&& BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;
Insert the specified value into this set if a key equivalent to value does not already exist in this set; otherwise, if a key equivalent to value already exists in this set, 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. The average and worst case complexity of this operation is not affected by the specified hint. This method requires that the (template parameter) type KEY be move‐insertable (see {Requirements on KEY}) into this set. The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included). Note that hint is ignored (other than possibly asserting its validity in some build modes).
Insert the specified value into this set if a key equivalent to value does not already exist in this set; otherwise, if a key equivalent to value already exists in this set, this method has no effect. Return an iterator referring to the (possibly newly inserted) value_type object in this set that is equivalent to value. The average and worst case complexity of this operation is not affected by the specified hint. This method requires that the (template parameter) type KEY be copy‐constructible into this set (see {Requirements on KEY}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included). Note that hint is ignored (other than possibly asserting its validity in some build modes).
iterator
insert(
const_iterator hint,
value_type const& value);
Insert into this set the value of each value_type object in the range starting at the specified first iterator and ending immediately before the specified last iterator, if a key equivalent to the object is not already contained in this set. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to value_type, and value_type must be emplace‐constructible from *i into this set, where i is a dereferenceable iterator in the range [first .. last)] (see {Requirements on KEY}). The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.
template<class INPUT_ITERATOR>
void
insert(
INPUT_ITERATOR first,
INPUT_ITERATOR last);
Insert the specified value into this set if a key equivalent to value does not already exist in this set; otherwise, if a key equivalent to value already exists in this set, 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. The average and worst case complexity of this operation is not affected by the specified hint. This method requires that the (template parameter) type KEY be move‐insertable (see {Requirements on KEY}) into this set. The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included). Note that hint is ignored (other than possibly asserting its validity in some build modes).
template<class LOOKUP_KEY>
iterator
insert(
const_iterator,
LOOKUP_KEY&& value)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
&& BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value
&& !bsl::is_convertible<LOOKUP_KEY&&, iterator>::value
&& !bsl::is_convertible<LOOKUP_KEY&&, const_iterator>::value;
Created with MrDocs