insert_or_assign
Bimap::insert_or_assign
Inserts an element into the Bimap, according to a key. If the data already exists, its value changes.
Declaration
template <typename T, typename U>
void insert_or_assign(const T& key, const U& elem);
Parameters
Name |
Type |
Description |
---|---|---|
key |
T |
The key of the element to add. |
elem |
U |
The element to add to the Bimap. |
Returns
None.
Notes
The key
is assigned to an element
, but as the Bimap is bidirectional, the element
is also the key for the key
.
Declaration
template <typename T, typename U>
void insert_or_assign(const TU& key, const T& elem);
Parameters
Name |
Type |
Description |
---|---|---|
key |
U |
The key of the element to add. |
elem |
T |
The element to add to the Bimap. |
Returns
None.
Notes
The key
is assigned to an element
, but as the Bimap is bidirectional, the element
is also the key for the key
.