folly::emplace_args

Argument tuple for variadic emplace/constructor calls. Stores arguments by (decayed) value. Restores original argument types with reference qualifiers and adornments at unpack time to emulate perfect forwarding.

Synopsis

Declared in <folly/container/Iterator.h>

template<typename... Args>
struct emplace_args
    : std::tuple<std::decay_t<Args>...>

Description

Uses inheritance instead of a type alias to std::tuple so that emplace iterators with implicit unpacking disabled can distinguish between emplace_args and std::tuple parameters.

Base Classes

NameDescription
std::tuple<std::decay_t<Args>...>

Types

Name
_AssignPredicateFromPair
_BothImplicitlyConvertible
_CtorPredicateFromPair
_EnableAssignFromPair
_EnableCtorFromPair
_EnableCtorFromUTypesTuple
_EnableUTypesCtor
_IsThisTuple
_NothrowAssignFromPair
_NothrowConstructibleFromPair

Type Aliases

NameDescription
__trivially_relocatable
storage_type The underlying tuple type storing the decayed arguments.

Member Functions

NameDescription
operator= Assignment operators
swap

Using Declarations

Name
Unnamed using

Non-Member Functions

NameDescription
get_emplace_argGetter function for unpacking a single emplace argument from an lvalue pack.
get_emplace_argGetter function for unpacking a single emplace argument.
get_emplace_argGetter function for unpacking a single emplace argument from a const pack.
make_emplace_argsPack arguments in a tuple for assignment to a folly::emplace_iterator, folly::front_emplace_iterator, or folly::back_emplace_iterator. The iterator's operator= will unpack the tuple and pass the unpacked arguments to the container's emplace function, which in turn forwards the arguments to the (multi-argument) constructor of the target class.