boost::gil::histogram::try_emplace
Attempts to build and insert a std::pair into the %unordered_map.
Synopsis
Declared in <boost/gil/histogram.hpp>
template<typename... _Args>
iterator
try_emplace(
const_iterator __hint,
key_type const& __k,
_Args&&... __args);
Description
This function is not concerned about whether the insertion took place, and thus does not return a boolean like the single‐argument emplace() does. However, if insertion did not take place, this function has no effect. Note that the first parameter is only a hint and can potentially improve the performance of the insertion process. A bad hint would cause no gains in efficiency.
See https://gcc.gnu.org/onlinedocs/libstdc++/manual/associative.html#containers.associative.insert_hints for more on hinting.
Insertion requires amortized constant time.
Return Value
An iterator that points to the element with key of the std::pair built from __args (may or may not be that std::pair).
Parameters
Name |
Description |
__hint |
An iterator that serves as a hint as to where the pair should be inserted. |
__k |
Key to use for finding a possibly existing pair in the unordered_map. |
__args |
Arguments used to generate the .second for a new pair instance. |
Created with MrDocs