Quick Links:

bal | bbl | bdl | bsl

bdlf::Bind_FuncTraits< RET, FUNC > Struct Template Reference

#include <bdlf_bind.h>


Detailed Description

template<class RET, class FUNC>
struct bdlf::Bind_FuncTraits< RET, FUNC >

This struct provides various traits of the functor type FUNC documented below. If RET is bslmf::Nil, then the return type is inferred by using either bslmf::FunctionPointerTraits, bslmf::MemberFunctionPointerTraits, or typename FUNC::result_type as appropriate.

     // ENUMERATIONS
     enum {
         k_IS_EXPLICIT            // An invocable object is explicit if ...
                                  // (see 'Bind_ImplExplicit')
    
       , k_PARAM_OFFSET           // Offset for calculating evaluation of
                                  // placeholder values at invocation.  Will
                                  // be 1 for member function pointers, and 0
                                  // otherwise.
    
       , k_HAS_POINTER_SEMANTICS  // Whether the bound functor should be
                                  // invoked by address or by value.
     };
    
     // PUBLIC TYPES
     typedef ... Type;         // type of the bound function object
     typedef ... WrapperType;  // type of the bound object wrapper
     typedef ... ResultType;   // return type of the bound function object
     typedef ... ArgumentList; // signature of the bound function object

The table below gives a summary of the values set by the specializations of Bind_FuncTraitsImp, where X represents a class type and T represents the return type (given explicitly by RET, or deduced by the nested ResultType of X or of the appropriate traits when RET is specified as bslmf::Nil).

RET FUNC IS _FN IS_FNP IS_MEM IS_EXPLICIT OFFSET PTR_SEM --------- ------- ------ ------ ------ ----------- ------ ------- T T(...) 1 0 0 1^ 0 0 T T(*)(...) 0 1 0 1^ 0 0 T T(X::*)(...) 0 0 1 1 1 0 T X 0 0 0 0 A B T X* 0 0 0 0 A 1 bslmf::Nil T(...) 1 0 0 1^ 0 0 bslmf::Nil T(*)(..) 0 1 0 1^ 0 0 bslmf::Nil T(X::*)(...) 0 0 1 1 1 0 bslmf::Nil X 0 0 0 0 A B bslmf::Nil X* 0 0 0 0 A 1

A: undefined, since unused by Bin_Impl, which is used for non-explicit binders. B: as determined by the value of bslalg_TypeTraits<X, bslalg::TypeTraitHasPointerSemantics>. ^: in the (rare) case where the FUNC type has an ellipsis argument, the k_IS_EXPLICIT will be set to 0. Note that we only support the ellipsis in non-member functions.

See Component bdlf_bind


The documentation for this struct was generated from the following file: