From: "David Abrahams" <[EMAIL PROTECTED]>
> Sylvain Pion <[EMAIL PROTECTED]> writes:
>
[...]
> > Access to the arity is supposed to be done with an Arity_traits<>, so
that
> > it can be made to work with std:: functors as well, e.g. :
> >
> > template < class T >
> > struct Arity_traits< std::plus< T > > {
> >   typedef Arity_tag< 2 > Arity;
> > };
>
> And that's supposed to be spelled:
>
>  template < class T >
>  struct Arity_traits< std::plus< T > > {
>    typedef Arity_tag< 2 > type;
>  };
>
> So that it can be used with MPL. But that's beside the point. Finding
> the arity is just one small piece of the puzzle. I need the types of
> all the arguments.

Looks like you'll have to define the standard interface. :-)

template<class F> struct arity_of;  // ::value, ::type
template<class F> struct result_type_of; // ::type
template<class F, int I> struct argument_type_of; // ::type

On the function object side, the current

struct F
{
    typedef void result_type;
    enum { arity = 2 };
    typedef int arg1_type;
    typedef long const & arg2_type;
};

looks reasonable, but it might be interesting to explore the

struct F
{
    typedef void signature(int, long const &);
};

alternative. That's one of things I keep forgetting to suggest for
Boost(Std?).Function.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to