Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-07-10 20:21:02

On Mon, 10 Jul 2006 10:24:29 -0700, "Eric Niebler"
<eric_at_[hidden]> wrote:

>Last week, at Scott's prodding, I took the issue up again and finally
>resolved the lvalue/rvalue problem. The result is a macro MAX(a,b) that
>behaves *exactly* like ((a)<(b)?(b):(a)), except that it does not
>reevaluate its arguments.

Hi Eric,

I thought I could throw an idea even if I had no time to examine your
code. Generally speaking I find it grotesque that one has to go
through contortions for such simple "primitives" (gcc has had builtin
operators for min and max for years now). My question is: is your
solution extendible to different operations, such that one could write
(not necessarily with that syntax):

  f(x, y) = v

rather then

  max(x, y) = v


In this case you would have a little "framework" to build modifiable
lvalues upon binary functions or function objects.

[ Gennaro Prota, C++ developer for hire ]
[    resume:  available on request      ]

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