Boost logo

Boost Users :

Subject: Re: [Boost-users] proto: BOOST_PROTO_AUTO
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-05 20:30:09


AMDG

Kim Kuen Tang wrote:
> Hi Eric,
>
> thank you for your quick response.
>
> It is interesting to see that expression like "Domain( [0,1] )" is
> not allowed. I think the reason is that such expression cannot be
> transformed in a tree or the transformation is not unique.
>
> But why does the code "proto::display_expr(Domain[1,2]);" produce the
> output:
>
> subscript(
> terminal(domain_tag)
> ,terminal(2)
> )
>
> and not
>
> subscript(
> terminal(domain_tag)
> ,terminal(1)
> ,terminal(2)
> ) ?

The evaluation goes like this:

1, 2 -> 2 --- by the built in comma operator
Domain[2] -> subscript(terminal(domain_tag),terminal(2)) -- by proto's
operator[]

In Christ,
Steven Watanabe


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