Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Reducing domain check in operator
From: Eric Niebler (eric_at_[hidden])
Date: 2009-02-26 17:33:59


Joel Falcou wrote:
> Eric Niebler a écrit :
>> Joel Falcou wrote:
>>> Eric Niebler a écrit :
>>>> Cool.
>>>
>>> Small variation. If I want the domain of A(B) always be X, I just
>>> specify it with make_expr ?
>>
>> Yes, or else make A a Proto terminal in the X domain.
>>
> with :
>
> terminal< A_, X>::type A
>
> or by another mean ??

In the usual way with a Proto extension. E.g.,

   simd_expr<terminal<A_>::type> A = {{}};

where simd_expr<> is an expression extension (i.e., uses
proto::extends<> or BOOST_PROTO_EXTENDS()). When you define the
extension type, you specify the domain, and any terminals wrapped in
that extension wrapper are automatically in that domain.

HTH,

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

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