std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::insert

Inserts element(s) into the container, if the container does not already contain an element with an equivalent key.

# Declarations

std::pair<iterator, bool> insert( const value_type& value );

(since C++23)

std::pair<iterator, bool> insert( value_type&& value );

(since C++23)

iterator insert( const_iterator pos, const value_type& value );

(since C++23)

iterator insert( const_iterator pos, value_type&& value );

(since C++23)

template< class P >
std::pair<iterator, bool> insert( P&& x );

(since C++23)

template< class P >
iterator insert( const_iterator pos, P&& x );

(since C++23)

template< class InputIt >
void insert( InputIt first, InputIt last );

(since C++23)

template< class InputIt >
void insert( std::sorted_unique_t, InputIt first, InputIt last );

(since C++23)

void insert( std::initializer_list<key_type> ilist );

(since C++23)

void insert( std::sorted_unique_t s, std::initializer_list<key_type> ilist );

(since C++23)

# Parameters

# Notes

The hinted insert (3,4,6) does not return a boolean in order to be signature-compatible with positional insert on sequential containers, such as std::vector::insert. This makes it possible to create generic inserters such as std::inserter. One way to check success of a hinted insert is to compare size() before and after.

# Example

This section is incompleteReason: no example

# See also