This struct provides a namespace for utility functions used to construct Bind and BindWrapper objects. Four families of factory methods are provided: bind, bindR, bindS, and bindSR. All factory methods accept an invocable object, optionally followed by up to fourteen additional arguments. Each argument can be either a literal value, a place‐holder, or another Bind or BindWrapper object.
Synopsis
Declared in <bdlf_bind.h>
class BindUtil;
Description
The BindUtil class methods compute the signature of the function object automatically, including the return type, and return a binder object with the specified bound functor and bound arguments. Memory for copying the bound functor and bound arguments is supplied by the user specified allocator if bindS, or bindSR is used, or the currently installed default allocator, if bind or bindR is used. The return type is inferred by using bslmf::FunctionPointerTraits for free function references and pointers, bslmf::MemberFunctionPointerTraits for member function pointers, and typenname t_FUNC::ResultType for a functor of type t_FUNC.
The bindR and bindSR variations must be used when binding to an object for which a result type cannot be automatically determined.