Quick Links:

bal | bbl | bdl | bsl

Public Types | Static Public Member Functions

bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES > Struct Template Reference

#include <bslmf_invokeresult.h>

Inheritance diagram for bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >:
bslmf::InvokeResult_ImpUtils

List of all members.

Public Types

enum  {
  k_INDEX, k_IS_POINTER = (k_INDEX == InvokeResult_Index::e_POINTER), k_IS_LVALUE, k_IS_CONST_PTR,
  k_IS_VOLATILE_PTR, k_TARGET_INDEX, k_IS_CONST_TARGET, k_IS_VOLATILE_TARGET,
  k_CANT_DEDUCE_TYPE
}
typedef bsl::decay< t_FN >::type F
typedef bsl::conditional
< !k_CANT_DEDUCE_TYPE,
typename InvokeResult_Type
< k_TARGET_INDEX >::type,
typename ResultType< F,
InvokeResultDeductionFailed >
::type >::type 
UnqualTargetType
typedef InvokeResult_AddCVRef
< UnqualTargetType,
static_cast< bool >
k_IS_CONST_TARGET)&&!static_cast
< bool >k_CANT_DEDUCE_TYPE),
static_cast< bool >
k_IS_VOLATILE_TARGET)&&!static_cast
< bool >k_CANT_DEDUCE_TYPE),
false >::type 
CVQualTargetType
typedef bsl::conditional
< static_cast< bool >
k_IS_POINTER)&&!static_cast
< bool >k_CANT_DEDUCE_TYPE),
typename bsl::add_pointer
< CVQualTargetType >::type,
CVQualTargetType >::type 
UnqualType
typedef InvokeResult_AddCVRef
< UnqualType, static_cast
< bool >k_IS_CONST_PTR)&&!static_cast
< bool >k_CANT_DEDUCE_TYPE),
static_cast< bool >
k_IS_VOLATILE_PTR)&&!static_cast
< bool >k_CANT_DEDUCE_TYPE),
static_cast< bool >k_IS_LVALUE)&&!static_cast
< bool >k_CANT_DEDUCE_TYPE)>
::type 
Qtype
typedef bsl::conditional
< static_cast< bool >
k_IS_LVALUE), Qtype, typename
bsl::remove_cv< Qtype >::type >
::type 
type

Static Public Member Functions

template<class t_SOME_TYPE >
static t_SOME_TYPE myDeclval ()
static bslmf::Tag< false > checkLvalue (AnyRvalue,...)
static bslmf::Tag< truecheckLvalue (AnyLvalue, int)
template<class t_TP >
static bslmf::Tag< false > checkConst (t_TP &)
template<class t_TP >
static bslmf::Tag< truecheckConst (const t_TP &)
template<class t_TP >
static bslmf::Tag< false > checkVolatile (t_TP &)
template<class t_TP >
static bslmf::Tag< false > checkVolatile (const t_TP &)
template<class t_TP >
static bslmf::Tag< truecheckVolatile (volatile t_TP &)
template<class t_TP >
static bslmf::Tag< truecheckVolatile (const volatile t_TP &)
template<class t_TP >
static t_TP & uncv (const t_TP &)
template<class t_TP >
static t_TP & uncv (const volatile t_TP &)
template<class t_TP >
static t_TP & unpoint (t_TP &)
template<class t_TP >
static const t_TP & unpoint (const t_TP &)
template<class t_TP >
static bsl::enable_if
<!bsl::is_void< t_TP >::value,
t_TP >::type
unpoint (t_TP *&)
template<class t_TP >
static bsl::enable_if
<!bsl::is_void< t_TP >::value,
t_TP >::type
unpoint (t_TP *const &)
template<class t_TP >
static bsl::enable_if
<!bsl::is_void< t_TP >::value,
t_TP >::type
unpoint (t_TP *volatile &)
template<class t_TP >
static bsl::enable_if
<!bsl::is_void< t_TP >::value,
t_TP >::type
unpoint (t_TP *const volatile &)

Detailed Description

template<bool, class t_FN, class... t_ARGTYPES>
struct bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >

Deduce return type of t_FN(t_ARGTYPES...). This template is instantiated only when t_FN is of class type (i.e., a functor). This primary template is selected when t_FN(t_ARGTYPES...) is not void. Note that this template is not defined in C++11 mode (if decltype exists).

See Component bslmf_invokeresult


Member Typedef Documentation

template<bool , class t_FN , class... t_ARGTYPES>
typedef bsl::decay<t_FN>::type bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >::F
template<bool , class t_FN , class... t_ARGTYPES>
typedef bsl::conditional< ! k_CANT_DEDUCE_TYPE, typename InvokeResult_Type<k_TARGET_INDEX>::type, typename ResultType<F,InvokeResultDeductionFailed>::type >::type bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >::UnqualTargetType
template<bool , class t_FN , class... t_ARGTYPES>
typedef InvokeResult_AddCVRef<UnqualTargetType, static_cast<bool>k_IS_CONST_TARGET) && ! static_cast<bool>k_CANT_DEDUCE_TYPE), static_cast<bool>k_IS_VOLATILE_TARGET) && ! static_cast<bool>k_CANT_DEDUCE_TYPE), false>::type bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >::CVQualTargetType

The deduced target after adding back previously-stripped cv qualifiers, if any. Note that if the expression yielded a pointer type, these cv qualifiers apply to the target of the pointer, not the pointer itself.

template<bool , class t_FN , class... t_ARGTYPES>
typedef bsl::conditional<static_cast<bool>k_IS_POINTER) && ! static_cast<bool>k_CANT_DEDUCE_TYPE), typename bsl::add_pointer<CVQualTargetType>::type, CVQualTargetType>::type bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >::UnqualType

The deduced result after adding back previously-stripped pointers, if any.

template<bool , class t_FN , class... t_ARGTYPES>
typedef InvokeResult_AddCVRef< UnqualType, static_cast<bool>k_IS_CONST_PTR) && ! static_cast<bool>k_CANT_DEDUCE_TYPE), static_cast<bool>k_IS_VOLATILE_PTR) && ! static_cast<bool>k_CANT_DEDUCE_TYPE), static_cast<bool>k_IS_LVALUE) && ! static_cast<bool>k_CANT_DEDUCE_TYPE)>::type bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >::Qtype

The deduced result after adding back previously-stripped cv qualifiers and references. Note that if the result is a pointer, the cv qualifiers apply to the pointer, not to the target.

template<bool , class t_FN , class... t_ARGTYPES>
typedef bsl::conditional<static_cast<bool>k_IS_LVALUE), Qtype, typename bsl::remove_cv<Qtype>::type>::type bslmf::InvokeResult_FunctorDeduction< bool, t_FN, t_ARGTYPES >::type

The final deduced result type. If the type is not a reference, top-level cv qualifiers are stripped off.


Member Enumeration Documentation

template<bool , class t_FN , class... t_ARGTYPES>
anonymous enum

In an unevaluated context (BSLMF_TAG_TO_INT), "invoke" myDeclval<t_FN>()(myDeclval<t_ARGTYPES>()...) and use overloading to deduce the type and other attributes of the return value.

Enumerator:
k_INDEX 
k_IS_POINTER 
k_IS_LVALUE 
k_IS_CONST_PTR 
k_IS_VOLATILE_PTR 
k_TARGET_INDEX 
k_IS_CONST_TARGET 
k_IS_VOLATILE_TARGET 
k_CANT_DEDUCE_TYPE 

Member Function Documentation

template<class t_SOME_TYPE >
static t_SOME_TYPE bslmf::InvokeResult_ImpUtils::myDeclval (  )  [static, inherited]

Return an object of the specified t_SOME_TYPE template parameter type. This function is declared but not defined and is intended to be called in an unevaluated context. Because there is no definition, the available constructors for t_SOME_TYPE are irrelevant.

static bslmf::Tag<false> bslmf::InvokeResult_ImpUtils::checkLvalue ( AnyRvalue  ,
  ... 
) [static, inherited]
static bslmf::Tag<true > bslmf::InvokeResult_ImpUtils::checkLvalue ( AnyLvalue  ,
int   
) [static, inherited]

(Declared but not defined) Return bslmf::Tag<false>() if the first argument is an rvalue and bslmf::Tag<true>() if it is lvalue. In actual use, the second argument is always a literal int, which causes the second overload to be preferred in case of ambiguity.

template<class t_TP >
static bslmf::Tag<false> bslmf::InvokeResult_ImpUtils::checkConst ( t_TP &   )  [static, inherited]
template<class t_TP >
static bslmf::Tag<true> bslmf::InvokeResult_ImpUtils::checkConst ( const t_TP &   )  [static, inherited]

(Declared but not defined) Return bslmf::Tag<true>() if the argument is const-qualified and bslmf::Tag<false>() otherwise.

template<class t_TP >
static bslmf::Tag<false> bslmf::InvokeResult_ImpUtils::checkVolatile ( t_TP &   )  [static, inherited]
template<class t_TP >
static bslmf::Tag<false> bslmf::InvokeResult_ImpUtils::checkVolatile ( const t_TP &   )  [static, inherited]
template<class t_TP >
static bslmf::Tag<true> bslmf::InvokeResult_ImpUtils::checkVolatile ( volatile t_TP &   )  [static, inherited]
template<class t_TP >
static bslmf::Tag<true> bslmf::InvokeResult_ImpUtils::checkVolatile ( const volatile t_TP &   )  [static, inherited]

(Declared but not defined) Return bslmf::Tag<true>() if the argument is volatile-qualified and bslmf::Tag<false>() otherwise. Note that if t_TP is both const- and volatile-qualified, it will not match volatile t_TP&, hence the need for the const overloads.

template<class t_TP >
static t_TP& bslmf::InvokeResult_ImpUtils::uncv ( const t_TP &   )  [static, inherited]
template<class t_TP >
static t_TP& bslmf::InvokeResult_ImpUtils::uncv ( const volatile t_TP &   )  [static, inherited]

(Declared but not defined) Return the argument, with cv-qualifiers removed.

template<class t_TP >
static t_TP& bslmf::InvokeResult_ImpUtils::unpoint ( t_TP &   )  [static, inherited]
template<class t_TP >
static const t_TP& bslmf::InvokeResult_ImpUtils::unpoint ( const t_TP &   )  [static, inherited]
template<class t_TP >
static bsl::enable_if<!bsl::is_void<t_TP>::value, t_TP>::type& bslmf::InvokeResult_ImpUtils::unpoint ( t_TP *&   )  [static, inherited]
template<class t_TP >
static bsl::enable_if<!bsl::is_void<t_TP>::value, t_TP>::type& bslmf::InvokeResult_ImpUtils::unpoint ( t_TP *const &   )  [static, inherited]
template<class t_TP >
static bsl::enable_if<!bsl::is_void<t_TP>::value, t_TP>::type& bslmf::InvokeResult_ImpUtils::unpoint ( t_TP *volatile &   )  [static, inherited]
template<class t_TP >
static bsl::enable_if<!bsl::is_void<t_TP>::value, t_TP>::type& bslmf::InvokeResult_ImpUtils::unpoint ( t_TP *const volatile &   )  [static, inherited]

If the argument type t_TP is pointer to type X, where X is not cv-'void', return a reference to X; otherwise return a reference to t_TP. Note that these functions are declared but not defined and are intended to be called only in an unevaluated context.


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