1.26.2.1
Prysm
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
  • number of arguments
  • whether it is a pointer to a 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)>
{
};
}
}