Boost logo

Boost Users :

Subject: Re: [Boost-users] [proto] Matching grammars in the presence of adapted types
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2010-06-04 12:02:09


Eric Niebler wrote:
> Seems like a bug in Proto. Can you file a bug and attach a complete,
> compilable example that demonstrates the problem?
>
OK, will do on Monday.
> Well, using proto::extends is the way to go. I can help you do that,
> once I figure out what you're really mean by:
>
> class smartint : public simd_expr<proto::terminal<smartint>::type>
>
> Usually, you can handle this sort of thing by making a separate
> smartint_impl class that has the data, and defining smartint as:
>
> class smartint : public simd_expr<proto::terminal<smartint_impl>::type>
>
> Does that help?
>
That seems to be what I want to do. My goal is to have a Blitz++-style
type, i.e. every expression written on a single line is first captured
as an expression template, optimized by metafunctions, and evaluated as
a whole. smartint is the basic arithmetic type in this scheme, so I want
every expression involving a smartint to be a Proto expression
(simd_expr). simd_expr then has an implicit conversion back to smartint
that evaluates the expression.

Sebastian


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