[#bsl-function-0a-2constructor-03f] = xref:bsl.adoc[bsl]::xref:bsl/function-0a.adoc[function]::function :relfileprefix: ../../ :mrdocs: Create an object wrapping the specified `func` callable object. Use the default allocator to supply memory. If `func` is a null pointer or null pointer‐to‐member, then the resulting object will be empty. This constructor will not participate in overload resolution if `func` is of the same type as (or reference compatible with) this object (to avoid ambiguity with the copy and move constructors) or is an integral type (to avoid matching null pointer literals). In C++03, this function will not participate in overload resolution if `FUNC` is a `MovableRef` (see overload, below), and instantiation will fail unless `FUNC` is invocable using the arguments and return type specified in `PROTOTYPE`. In C++11 and later, this function will not participate in overload resolution if `FUNC` is not invocable using the arguments and return type specified in `PROTOTYPE`. Note that this constructor implicitly converts from any type that is so invocable. == Synopsis Declared in `<bslstl_function.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class FUNC> function(FUNC&& func) requires ! IsReferenceCompatible<typename Decay<FUNC>::type, function>::value && IsInvocableWithPrototype< typename Decay<FUNC>::type>::value; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#