[#BloombergLP-bslstl-Function_Rep-installFunc] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Function_Rep.adoc[Function_Rep]::installFunc :relfileprefix: ../../../ :mrdocs: Install `func` as the target and set the invoker, or leave empty. == Synopsis Declared in `<bslstl_function_rep.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FUNC> void installFunc( FUNC&& func, xref:BloombergLP/bslstl/Function_Rep/GenericInvoker.adoc[GenericInvoker] invoker); ---- == Description Do nothing if the specified `func` is a null pointer, otherwise allocate storage (either in‐place within this object's small‐object buffer or out‐of‐place from the allocator) to hold a target of (template parameter) type `FUNC`, forward the `func` to the constructor of the new target, set `d_funcManager_p` to manage the new target, and set `d_invoker_p` to the specified `invoker` address. The behavior is undefined unless this object is empty on entry. Note that `FUNC` will not qualify for the small‐object optimization unless `bsl::is_nothrow_move_constructible<FUNC>::value` is `true`. == Parameters [cols="1,4"] |=== | Name| Description | *func* | callable object to install as the target | *invoker* | invoker function for the installed target |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#