1.14.0.5
Hummingbird
A modern user interface library for games
cohtml::FunctorTraits< Functor > Class Template Reference

Provides information about function objects. More...

Inherited by cohtml::FunctorTraits< ResultType(ClassType::*)() const >, cohtml::FunctorTraits< ResultType(ClassType::*)(Arg0Type) const >, cohtml::FunctorTraits< ResultType(ClassType::*)(Arg0Type, Arg1Type) const >, cohtml::FunctorTraits< ResultType(ClassType::*)(Arg0Type, Arg1Type, Arg2Type) const >, cohtml::FunctorTraits< ResultType(ClassType::*)(Arg0Type, Arg1Type, Arg2Type, Arg3Type) const >, and cohtml::FunctorTraits< ResultType(ClassType::*)(Arg0Type, Arg1Type, Arg2Type, Arg3Type, Arg4Type) const >.

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 your 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)>
{
};
}
}