23 Containers library [containers]

23.4 Associative containers [associative]

23.4.4 Class template map [map] map modifiers [map.modifiers]

template <class P> pair<iterator, bool> insert(P&& x); template <class P> pair<iterator, bool> insert(const_iterator position, P&& x); template <class InputIterator> void insert(InputIterator first, InputIterator last);

Requires: P shall be convertible to value_type.

If P is instantiated as a reference type, then the argument x is copied from. Otherwise x is considered to be an rvalue as it is converted to value_type and inserted into the map. Specifically, in such cases CopyConstructible is not required of key_type or mapped_type unless the conversion from P specifically requires it (e.g., if P is a tuple<const key_type, mapped_type>, then key_type must be CopyConstructible). The signature taking InputIterator parameters does not require CopyConstructible of either key_type or mapped_type if the dereferenced InputIterator returns a non-const rvalue pair<key_type,mapped_type>. Otherwise CopyConstructible is required for both key_type and mapped_type.