try_emplace overloads

Synopses

Declared in <folly/synchronization/DelayedInit.h>

Gets the pre‐existing value if already initialized or constructs the value in‐place by direct‐initializing with the provided arguments.

template<typename... A>
T&
try_emplace(A&&... a);

Gets the pre‐existing value or constructs it in‐place from an initializer list and additional arguments.

template<
    typename U,
    typename... A>
requires std::is_constructible<T, std::initializer_list<U>, A...>::value
T&
try_emplace(
    std::initializer_list<U> ilist,
    A&&... a);

Return Value

A reference to the stored value.

Parameters

Name

Description

a

The arguments forwarded to the value's constructor on first access.

ilist

The initializer list forwarded to the value's constructor.

Created with MrDocs