Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 2000-03-18 00:22:46

on 3/17/00 10:53 PM, Greg Colvin at gcolvin_at_[hidden] wrote:

> Aha. But lots of operators (29 by my count) have higher precedence
> than /, so if it's precedence you want then you might overload []
> boost::lambda[ std::cout << ", " << boost::free1 ]

That one is evaluated like this:

        operator<<(std::cout, ", "),

Innermost expressions first. To use op[], you'd have to write this:

    boost::lambda[ std::cout ] << ", " << boost::free1

But I'm not so sure lambda/ is such a hot idea after all, since in this

    boost::lambda/ x + y * z

is the same as

    (boost::lambda/ x) + (y * z)

and the y * z term will be evaluated before it gets to interact with

Is there any way to salvage this approach? I don't see one :(


Boost list run by bdawes at, gregod at, cpdaniel at, john at