Return, by value, an object of the specified (template parameter) TARGET_TYPE, constructed by forwarding the specified argument1 and the (variable number of) additional specified arguments to the corresponding constructor of TARGET_TYPE. If the specified allocator is a bslma‐compatible allocator and TARGET_TYPE supports bslma‐style allocation, the allocator is passed to the constructor; otherwise, allocator is ignored. Note that this method is available only for compilers that reliably implement copy/move elision (i.e., RVO) on the returned object. This copy/move elision is required starting with C++17 and is widely implemented, though optional, prior to C++17. Note that, in C++03, perfect forwarding is limited such that any lvalue reference in the arguments parameter pack is const‐qualified when forwarded to the TARGET_TYPE constructor; only argument1 can be forwarded as an unqualified lvalue.

Synopsis

Declared in <bslma_constructionutil.h>

template<
    class TARGET_TYPE,
    class ALLOCATOR,
    class ARG1,
    class... ARGS>
static
TARGET_TYPE
make(
    ALLOCATOR const& allocator,
    ARG1&& argument1,
    ARGS&&... arguments);

Created with MrDocs