
On 5/6/2010 11:09 AM, Manjunath Kudlur wrote:
Thanks, Joel. (Note to self : RTFM more often :)). I also discovered that I didn't have to make the readonly and readwrite classes templated. The following also works :
This is even simpler :
template<typename T> struct readonly : proto::callable { typedef const T& result_type; };
<snip> If you define it like this: template<typename T, typename Dummy = proto::callable> struct readonly : proto::callable { typedef const T& result_type; }; ... then you don't need this:
namespace boost { namespace proto { template<class T> struct is_callable< readonly<T> > : mpl::true_ {}; template<class T> struct is_callable< readwrite<T> > : mpl::true_ {}; } }
HTH, -- Eric Niebler BoostPro Computing http://www.boostpro.com