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>
pair<iterator, bool>
try_emplace(
    key_type const& __k,
    _Args&&... __args);

Description

This function attempts to build and insert a (key, value) %pair into the %unordered_map. An %unordered_map relies on unique keys and thus a %pair is only inserted if its first element (the key) is not already present in the %unordered_map. If a %pair is not inserted, this function has no effect.

Insertion requires amortized constant time.

Return Value

A pair, of which the first element is an iterator that points to the possibly inserted pair, and the second is a bool that is true if the pair was actually inserted.

Parameters

Name

Description

__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