[#BloombergLP-bdlf-Bind_FuncTraits]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlf.adoc[bdlf]::Bind&lowbar;FuncTraits
:relfileprefix: ../../
:mrdocs:

This `struct` provides various traits of the functor type `t&lowbar;FUNC` documented below&period; If `t&lowbar;RET` is `bslmf&colon;&colon;Nil`, then the return type is inferred by using either `bslmf&colon;&colon;FunctionPointerTraits`, `bslmf&colon;&colon;MemberFunctionPointerTraits`, or `typename t&lowbar;FUNC&colon;&colon;result&lowbar;type` as appropriate&period; &grave; &sol;&sol; ENUMERATIONS enum &lcub; k&lowbar;IS&lowbar;EXPLICIT &sol;&sol; An invocable object is explicit if &period;&period;&period; &sol;&sol; (see &apos;Bind&lowbar;ImplExplicit&apos;)

== Synopsis

Declared in `&lt;bdlf&lowbar;bind&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;RET,
    class t&lowbar;FUNC&gt;
struct Bind&lowbar;FuncTraits
    : xref:BloombergLP/bdlf/Bind_FuncTraitsImp-05.adoc[Bind&lowbar;FuncTraitsImp&lt;t&lowbar;RET, t&lowbar;FUNC, (int)bslmf&colon;&colon;IsFunctionPointer&lt;t&lowbar;FUNC &ast;&gt;&colon;&colon;value, (int)bslmf&colon;&colon;IsFunctionPointer&lt;t&lowbar;FUNC&gt;&colon;&colon;value, (int)bslmf&colon;&colon;IsMemberFunctionPointer&lt;t&lowbar;FUNC&gt;&colon;&colon;value&gt;]
----

== Description

, k&lowbar;IS&lowbar;MEMBER&lowbar;OFFSET &sol;&sol; Offset for calculating evaluation of &sol;&sol; placeholder values at invocation&period; Will &sol;&sol; be 1 for member function pointers, and 0 &sol;&sol; otherwise&period;

, k&lowbar;HAS&lowbar;POINTER&lowbar;SEMANTICS &sol;&sol; Whether the bound functor should be &sol;&sol; invoked by address or by value&period; &rcub;&semi;

&sol;&sol; PUBLIC TYPES typedef &period;&period;&period; Type&semi; &sol;&sol; type of the bound function object typedef &period;&period;&period; WrapperType&semi; &sol;&sol; type of the bound object wrapper typedef &period;&period;&period; ResultType&semi; &sol;&sol; return type of the bound function &sol;&sol; object typedef &period;&period;&period; FuncArgumentList&semi; &sol;&sol; signature of the bound function object, &sol;&sol; a &apos;bslmf&colon;&colon;TypeList&apos; &grave; The table below gives a summary of the values set by the specializations of `Bind&lowbar;FuncTraitsImp`, where `X` represents a class type and `T` represents the return type (given explicitly by `t&lowbar;RET`, or deduced by the nested `ResultType` of `X` or of the appropriate traits when `t&lowbar;RET` is specified as `bslmf&colon;&colon;Nil`)&period;

t&lowbar;RET t&lowbar;FUNC IS &lowbar;FN IS&lowbar;FNP IS&lowbar;MEM IS&lowbar;EXPLICIT OFFSET PTR&lowbar;SEM &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; &hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen;&hyphen; T T(&period;&period;&period;) 1 0 0 1&circ; 0 0 T T(&ast;)(&period;&period;&period;) 0 1 0 1&circ; 0 0 T T(X&colon;&colon;&ast;)(&period;&period;&period;) 0 0 1 1 1 0 T X 0 0 0 0 A B T X&ast; 0 0 0 0 A 1 bslmf&colon;&colon;Nil T(&period;&period;&period;) 1 0 0 1&circ; 0 0 bslmf&colon;&colon;Nil T(&ast;)(&period;&period;) 0 1 0 1&circ; 0 0 bslmf&colon;&colon;Nil T(X&colon;&colon;&ast;)(&period;&period;&period;) 0 0 1 1 1 0 bslmf&colon;&colon;Nil X 0 0 0 0 A B bslmf&colon;&colon;Nil X&ast; 0 0 0 0 A 1

A&colon; undefined, since unused by `Bin&lowbar;Impl`, which is used for non&hyphen;explicit binders&period; B&colon; as determined by the value of `bslalg&lowbar;TypeTraits&lt;X, bslalg&colon;&colon;TypeTraitHasPointerSemantics&gt;`&period; &circ;&colon; in the (rare) case where the t&lowbar;FUNC type has an ellipsis argument, the k&lowbar;IS&lowbar;EXPLICIT will be set to 0&period; Note that we _only_ support the ellipsis in non&hyphen;member functions&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlf/Bind_FuncTraitsImp-05.adoc[Bind&lowbar;FuncTraitsImp&lt;t&lowbar;RET, t&lowbar;FUNC, (int)bslmf&colon;&colon;IsFunctionPointer&lt;t&lowbar;FUNC &ast;&gt;&colon;&colon;value, (int)bslmf&colon;&colon;IsFunctionPointer&lt;t&lowbar;FUNC&gt;&colon;&colon;value, (int)bslmf&colon;&colon;IsMemberFunctionPointer&lt;t&lowbar;FUNC&gt;&colon;&colon;value&gt;]`
| This `struct` provides a mechanism for inferring various traits of the function object type `t&lowbar;FUNC`&period; The return type is given by `t&lowbar;RET` unless it is `bslmf&colon;&colon;Nil` in which case it is inferred from `t&lowbar;FUNC`&period; The last three parameters `IS&lowbar;FUNCTION`, `IS&lowbar;FUNCTION&lowbar;POINTER` and `IS&lowbar;MEMBER&lowbar;FUNCTION&lowbar;POINTER` specify whether `t&lowbar;FUNC` is a free function type (either a reference&hyphen;to&hyphen;function or plain function type), a pointer to function type, or a pointer to member function type, respectively&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
