Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2005-08-06 14:06:25

"David Abrahams" <dave_at_[hidden]> wrote in message
> "Andy Little" <andy_at_[hidden]> writes:
>> The use of the dummy expression |frobnicates| is a poor substitute
>> for a user defined operator.
> Best we can do today. And it's not bad, once you understand how the
> library works. Just like in Boost.Lambda a+b doesn't add anything:
> it builds a function object. Just like in Boost.Spirit the operators
> are used for parsing.

The inbuilt operator you choose to subvert influences how the expression is
evaluated of course:

#define OP1 |frobnicates|
#define OP2 *frobnicates*

int a=0,b=0;
double c=0.,d=0.;
a+c OP1 b+d;
a+c OP2 b+d;

Andy Little

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