Boost logo

Boost Users :

Subject: [Boost-users] functors with function_traits
From: Christoph (christoph.duelli_at_[hidden])
Date: 2008-09-18 15:59:22


Do function_traits work with functors?

I tried with

struct XYZ
{
   bool operator() (int x) const { return x+2; }
};

template<typename FUNCTION>
class BindingImpl1xxx
{
public:
   typedef FUNCTION function;
   typedef typename boost::function_traits<FUNCTION>::result_type res_type;
   typedef typename boost::function_traits<FUNCTION>::arg1_type arg1_type;
};

but the following won't compile:
XYZ xyz;
BindingImpl1xxx<XYZ> xxx(xyz);

Is there a way to achieve the function_traits functionality with
function_traits or some other type_traits?

Thank you.
Christoph


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net