boost::gil::histogram::try_emplace

Attempts to build and insert a std::pair into the %unordered_map.

Synopses

Declared in <boost/gil/histogram.hpp>

Attempts to build and insert a std::pair into the %unordered_map.

template<typename... _Args>
pair<iterator, bool>
try_emplace(
    key_type const& __k,
    _Args&&... __args);
template<typename... _Args>
pair<iterator, bool>
try_emplace(
    key_type&& __k,
    _Args&&... __args);

Attempts to build and insert a std::pair into the %unordered_map.

template<typename... _Args>
iterator
try_emplace(
    const_iterator __hint,
    key_type const& __k,
    _Args&&... __args);
template<typename... _Args>
iterator
try_emplace(
    const_iterator __hint,
    key_type&& __k,
    _Args&&... __args);

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.

  • 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

__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.

__hint

An iterator that serves as a hint as to where the pair should be inserted.

Created with MrDocs