cheshirekow  v0.1.0
kw::has_member< Type > Class Template Reference

Template metafunction, ::result evaluates to true if Type has a function call operator member. More...

#include <kwargs/is_call_possible.h>

Classes

struct  DummyFnCallOperator
 Very simply, a class which has a function call operator. More...
 
struct  HasAtLeastOneFnCallOperator
 This class derives from both the argument of the meta function, and a class which we know has a function call operator. More...
 
class  Helper
 This template only exists for a pair of template parameters where the type of the second parameter is equivalent to the first parameter. More...
 
class  no
 
class  yes
 

Static Public Attributes

static const bool result
 

Static Private Member Functions

template<typename U >
static no deduce (U *, Helper< void(DummyFnCallOperator::*)(),&U::operator()>*=0)
 SFINAE. The first overload for deduce takes two arguments, the first is a pointer to an object. This parameter appears to be used only for type deduction. The second argument is a pointer to a Helper<> object. However, since the helper template only exists if &U::operator() is the same type as void (BaseMixin::*)() then this type only exists under the condition that Base has exactly one available overload for operator(), and it is the one that comes from BaseMixin. More...
 
static yes deduce (...)
 If the first definition of deduce has a substitution failuer then this is the one that the compiler finds. More...
 

Detailed Description

template<typename Type>
class kw::has_member< Type >

Template metafunction, ::result evaluates to true if Type has a function call operator member.

From: https://groups.google.com/forum/embed/#!topic/comp.lang.c++.moderated/T3x6lvmvvkQ

Definition at line 21 of file is_call_possible.h.

Member Function Documentation

template<typename Type >
template<typename U >
static no kw::has_member< Type >::deduce ( U *  ,
Helper< void(DummyFnCallOperator::*)(),&U::operator()>*  = 0 
)
staticprivate

SFINAE. The first overload for deduce takes two arguments, the first is a pointer to an object. This parameter appears to be used only for type deduction. The second argument is a pointer to a Helper<> object. However, since the helper template only exists if &U::operator() is the same type as void (BaseMixin::*)() then this type only exists under the condition that Base has exactly one available overload for operator(), and it is the one that comes from BaseMixin.

template<typename Type >
static yes kw::has_member< Type >::deduce (   ...)
staticprivate

If the first definition of deduce has a substitution failuer then this is the one that the compiler finds.

Member Data Documentation

template<typename Type >
const bool kw::has_member< Type >::result
static
Initial value:
=
sizeof(yes) == sizeof(deduce((HasAtLeastOneFnCallOperator*) (0)))

Definition at line 63 of file is_call_possible.h.


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