Boost logo

Proto :

Subject: [proto] Multi assignment expressions for vector DSEL
From: Ole Svensson (o.svensson_at_[hidden])
Date: 2014-01-06 10:25:11


for my vector expression DSEL I would like to be able to write multi assignment expressions like
y = x = 3.0 * z;
that effectively translate to
for(i=0; i<n; ++i) {
   y[i] = x[i] = 3.0 * z[i];
Currently, my proto-fied vector class has an operator=() that calls the respective context to evaluate the RHS of an assignment operation. With multi assignment expressions, I obviously have to include the assignment operator into my grammar. If I do this, how can I execute a context when I just write "y = x = 3.0 * z;"?

Thank you very much!

Best regards

Proto list run by eric at