[proto] Wrapper compile error

Eric, Here's a message I've owed you for a while. I mentioned a compile error with the ADL example for expression wrappers. I've attached a testcase. Uncommenting the commented bits and compiling with g++ results in an error message which leads me to believe that somewhere in the guts of proto there's an expectation that wrappers have one template argument. Usually this gets solved by using metafunction classes. Or, more likely, I'm just doing something wrong. :) -Dave

On 2/2/2010 3:40 PM, David A. Greene wrote:
somewhere in the guts of proto there's an expectation that wrappers have one template argument.
Yes, it's proto::pod_generator. You have this: // Expression wrapper template<class Expr, class Dummy = boost::proto::is_proto_expr> struct Wrapper { BOOST_PROTO_EXTENDS(Expr, Wrapper<Expr>, Domain) }; ... struct Domain : boost::proto::domain<boost::proto::pod_generator<Wrapper > > {}; pod_generator is documented as taking a single template template parameter, as follows: template<template<typename> class Extends> struct pod_generator The extra template parameter to Wrapper is not strictly necessary AFAICS, so perhaps you can just drop it. If not, you can define your own generator. It just needs to be a unary function object. See how pod_generator is defined. HTH, -- Eric Niebler BoostPro Computing http://www.boostpro.com
participants (2)
-
David A. Greene
-
Eric Niebler