std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::replace - cppreference.com (original) (raw)

| void replace( key_container_type&& key_cont, mapped_container_type&& mapped_cont ); | | (since C++23) | | ----------------------------------------------------------------------------------------- | | ------------- |

Replaces the underlying containers c. Equivalent to:

c.keys = std::move(key_cont); c.values = std::move(mapped_cont);

The following conditions must be met:

[edit] Parameters

keys_cont - a sorted keys container of type KeyContainer, the contents of which will be moved into *this
mapped_cont - a container of mapped values of type MappedContainer, the contents of which will be moved into *this

[edit] Return value

(none)

[edit] Complexity

Equals to complexity of std::move applied to adapted containers.

[edit] Example

[edit] See also

| | extracts the underlying containers (public member function) [edit] | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |