Boost logo

Boost :

Subject: Re: [boost] [Proto] Computing type in expression
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-15 09:12:21


On 6/15/2010 8:49 AM, joel falcou wrote:
> I have an expression wrapper class tied to a domain and a grammar.
> Everythign works ok except for the fact it seems I can't compute type
> inside the expression class that depends on the expression type itself.
> I end up with tons of incomplete type error in proto/fusion.hpp.
>
> The example is a bit big, i'm still working on a small repro but
> basically, what I do is using the expression framework from ym last mail
> is to have a value_type on expression which represent the value_type of
> the expression element.

template<class Expr>
struct wrap
  : proto::extends<Expr, wrap<Expr> >
{
  // Expr is complete here
  // wrap is not

  typedef typename some_fun<wrap>::type value_type; // NO
  typedef typename some_fun<Expr>::type value_type; // YES
};

Does that help?

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk