Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-03-20 12:18:10


From: "Gary Powell" <Gary.Powell_at_[hidden]>

> > >...or lvalue() and rvalue(). I like lvalue() better than var() du to
my
> > >hatrd of abbrevs.
> >
> > Those are even clearer. And they are specific terms defined in the C++
> > standard, so in that sense are not abbreviations.
> >
> > --Beman
> >
> I think var() and constant() are clearer in meaning for a lambda
expression.
> var() makes a variable into a lambda expression, and constant() evaluates
> the expression inside of () and makes a constant value out of it (constant
> as in not re-evaluated within the lambda expression.)

What I don't like about var() and constant() is their interaction with const
variables; lvalue and rvalue look clearer to me in this case; although those
are technical terms.

There's also the problem that many compilers have various quirks with
lambda-like libraries that are usually resolved by putting lvalue() or
rvalue() around the troublesome construct, so the functions end up being
used much more than necessary.

That's why I went with lv() and rv() - they are short, they are immediately
recognizable to those that know about l- and rvalues, yet do not convey any
meaning to people not "in the know", so those users can learn their behavior
from scratch without making false analogies.

--
Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk