shark::CanBeCalled< Functor, Argument > Struct Template Reference

detects whether Functor(Argument) can be called. More...

#include <shark/Core/utility/CanBeCalled.h>

Static Public Attributes

static bool const value
 

Detailed Description

template<class Functor, class Argument>
struct shark::CanBeCalled< Functor, Argument >

detects whether Functor(Argument) can be called.

Suppose you have a general Functor. It might take several arguments, some more suited for your computation than others. In this case one may want to check, which input argument may work. The exact implementation and inner workings are outlined in http://www.boost.org/doc/libs/1_52_0/doc/html/proto/appendices.html the trick is to generate a functor F2 from our supplied functor, such that F2(arg) is always a valid expression, but at the same time F2(arg) and F(arg) have clearly distinguishable return types. There are a few tricks needed for the case that F(arg) has return type void.

Definition at line 52 of file CanBeCalled.h.

Member Data Documentation

◆ value

template<class Functor , class Argument >
bool const shark::CanBeCalled< Functor, Argument >::value
static
Initial value:
= (
sizeof(no_type) == sizeof(is_private_type( (m_fun(m_arg), 0) ))
)

Definition at line 82 of file CanBeCalled.h.


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