1.4.0.3
Gameface
cohtml::FunctorTraits< Functor > Class Template Reference

Provides information about function objects. More...

Detailed Description

template<typename Functor>
class cohtml::FunctorTraits< Functor >

Provides information about function objects.

Provides the following information about a function object

  • return type
  • arity
  • whether it is pointer to member function
  • the type of each argument (with const and references stripped)

To support custom handlers, use the following pattern:

class SquareCalculator
{
public:
void double operator()(double r) const
{
return r * r;
}
};
// provide support for SquareCalculator to FunctorTraits
namespace Coherent
{
namespace cohtml
{
template <>
struct FunctorTraits<SquareCalculator>
: FunctorTraits<double (double)>
{
};
}
}