cpp/experimental/function/function

Constructs a from a variety of sources.

@1-2@ Creates an empty function.

@3@ Copies the target of to the target of. If is empty,  will be empty after the call too.

@4@ Moves the target of to the target of. If is empty,  will be empty after the call too.

@5@ Initializes the target with a copy of. If is a null pointer to function or null pointer to member,  will be empty after the call. This constructor does not participate in overload resolution unless f is for argument types  and return type.

@6-10@ Same as except that  is used to allocate memory for any internal data structures that the  might use.

When the target is a function pointer or a std, small object optimization is guaranteed, that is, these targets are always directly stored inside the std object, no dynamic allocation takes place. Other large objects may be constructed in dynamic allocated storage and accessed by the std object through a pointer.

If a constructor moves or copies a function object, including an instance of, then that move or copy is performed by using-allocator construction with allocator.

Exceptions
@3,8@ does not throw if 's target is a function pointer or a std, otherwise may throw std or any exception thrown by the copy constructor of the stored callable object.

@4@ (none)

@5,10@ does not throw if is a function pointer or a std, otherwise may throw std or any exception thrown by the copy constructor of the stored callable object.

@9@ (none)