
Joel FALCOU wrote:
Yes, in proto v4 contexts are not necessary. They can, in some circumstances, be easier to work with then transforms, so I don't plan to remove them. They may even be better at compile time. Make sense indeed. It may solve my other problem then. I need to perform SIMD computation onto my matrix element. For scalar, proto provided the appropriate overload for let's say +,-,*,/ and so on. I think hat using visitor may solve the problem of selecing the proper form of operation on the fly.
I'm not sure how the data parameter figures here. Wouldn't the semantic action be conditioned on the expression type? E.g., when an expression is a binary +, do the binary + action. For that, you'd just use a proto grammar decorated with transforms, and not involve the data parameter at all.
There are non-trivial changes, yes. Most significantly, the protocol for implementing custom transforms has changed. Also, a bunch of functions and types have been renamed as a result of review feedback. So, I better change now and adapt my code ?
Better IMO to wait until v4 is finished and committed to trunk.
How can the v4 be downloaded ?
It's in boost's subversion repository under the branches/proto/v4 directory.
Not sure what you mean. Can you give an example? I had the impression that terminal helds value by reference until it get transformed and turne dinto value.
You can certainly write a transform that turns terminal references into
values, but that's not the default behavior.
Consider the following program that promotes int terminal to longs and
leaves all others as-is:
#include <cstdio>
#include
Absolutely. A proto transform *IS* a semantic action. Ok then, the arguments are clear now :)
-- Eric Niebler BoostPro Computing http://www.boostpro.com