Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost][proto] Type inference using transform
From: joel falcou (joel.falcou_at_[hidden])
Date: 2010-05-06 04:56:03


Manjunath Kudlur wrote:
>
> I expected the typeid printed out by the foo function to be equivalent
> to "int&" whereas I get "readwrite<int>". Any clues on where I am
> going wrong?
>
Because that exactly what you ask in argtype ;)

What you are missing is the fact that you readonly/readwrite function
object are templated
and proto can't know they are callable without a small help. So you need
to add:

namspace boost { namespace proto
{
   template<class T> struct is_callable< readonly<T> > : mpl::true_ {};
   template<class T> struct is_callable< readwrite<T> > : mpl::true_ {};
} }

As stated in the doc, template trasnform don't trigger the callable
stuff automatically

-- 
___________________________________________
Joel Falcou - Assistant Professor
PARALL Team - LRI - Universite Paris Sud XI
Tel : (+33)1 69 15 66 35

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