[#bsl-function-0a] = xref:bsl.adoc[bsl]::function :relfileprefix: ../ :mrdocs: Forward declaration. == Synopsis Declared in `<bslstl_function.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class PROTOTYPE> class function : public xref:BloombergLP/bslstl/Function_Variadic-0e.adoc[BloombergLP::bslstl::Function_Variadic<PROTOTYPE>] ---- == Base Classes [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/bslstl/Function_Variadic-0e.adoc[BloombergLP::bslstl::Function_Variadic<PROTOTYPE>]` | This component‐private class template contains the physical representation and provides the variadic interfaces for `bsl::function`. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/function-0a/allocator_type.adoc[`allocator_type`] | Alias for the allocator type of the function representation. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/function-0a/2constructor-075.adoc[`function`] [.small]#[constructor]# | Constructors | xref:bsl/function-0a/operator_assign-01.adoc[`operator=`] | Assignment operators | xref:bsl/function-0a/allocator.adoc[`allocator`] | Return `get_allocator().mechanism()`. Note that this function exists for BDE compatibility and is not part of the C++ Standard Library. | xref:bsl/function-0a/get_allocator.adoc[`get_allocator`] | Return (a copy of) the allocator used to supply memory for this `function`. | xref:bsl/function-0a/isInplace.adoc[`isInplace`] | Return whether this object's target uses in‐place storage. | xref:bsl/function-0a/swap.adoc[`swap`] | Exchange the targets held by this `function` and the specified `other`. | xref:bsl/function-0a/target-0a9.adoc[`target`] | `target` overloads | xref:bsl/function-0a/target_type.adoc[`target_type`] | Return `typeid(void)` if this object is empty; otherwise `typeid(FUNC)` where `FUNC` is the type of the target object. | xref:bsl/function-0a/2conversion-05.adoc[`operator BloombergLP::bdef_Function<PROTOTYPE*>&`] | Convert `*this` to a mutable `bdef_Function` reference by downcasting. | xref:bsl/function-0a/2conversion-0d.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<function, UsesAllocatorArgT>`] | Nested trait declaration for `bslmf::UsesAllocatorArgT`. | xref:bsl/function-0a/2conversion-0a.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<function, UsesBslmaAllocator>`] | Nested trait declaration for `bslma::UsesBslmaAllocator`. | xref:bsl/function-0a/2conversion-07.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<function, is_nothrow_move_constructible>`] | Nested trait declaration for `is_nothrow_move_constructible`. | xref:bsl/function-0a/2conversion-03.adoc[`operator bool`] | Return whether this `function` currently holds a target. | xref:bsl/function-0a/2conversion-0c.adoc[`operator BloombergLP::bdef_Function<PROTOTYPE*> const&`] | Convert `*this` to a const `bdef_Function` reference by downcasting. |=== == Using Declarations [cols="1,4"] |=== | Name| Description | xref:bsl/function-0a/operator().adoc[`operator()`] | Invoke the target with the call arguments, or throw if empty. |=== == Deduction Guides [cols="1,4"] |=== | Name| Description | xref:bsl/function-00.adoc[`function<PROTOTYPE>`] | Deduce the template parameter `PROTOTYPE` from the signature of the `operator()` of the functor supplied to the constructor of `function`. | xref:bsl/function-066.adoc[`function<PROTOTYPE>`] | Deduce the template parameter `PROTOTYPE` from the signature of the `operator()` of the functor supplied to the constructor of `function`. | xref:bsl/function-06d.adoc[`function<RET(ARGS...)>`] | Deduce the template parameter `PROTOTYPE` from the signature of the function supplied to the constructor of `function`. | xref:bsl/function-05.adoc[`function<RET(ARGS...)>`] | Deduce the template parameter `PROTOTYPE` from the signature of the function supplied to the constructor of `function`. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/operator_not_eq-0b.adoc[`operator!=`] | Return `true` if the specified `function` is not empty. | xref:bsl/operator_eq-09d2.adoc[`operator==`] | Return `true` if the specified `function` is empty. | xref:bsl/swap-026.adoc[`swap`] | Exchange the targets held by the specified `a` and `b` functions. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#