Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2003-12-12 21:57:12

Several boost libraries use _1, _2, ... as placeholders: Bind, Lamda and
MPL. When using MPL or Lambda, one can avoid the inconvenience of explicit
namespace qualification with using declarations. Clashes are not generally a
problem, since it is usually not necessary to use any two of these libraries
in the same bit of code.

What happens, however, if a library author wishes to define special
placeholder symbols, but also expects the library to be used in conjunction
with the lambda facilities of one of the above libraries? Requiring explicit
namespace qualification would make user code hard to read, eliminating much
of the clarity which lamda expressions are supposed to provide. Using one,
two, ... or _one, _two, ... is not nearly as elegant. Using 1_, 2_, ... or
_1_, _2_would probably result in confusion.

I'm toying with the idea of allowing $1, $2, ... as alternatives to _1, _2,
.... on platforms which support the dollar sign in identifiers. I assume the
universal response to this would be that it is unworkable, dangerous, ugly
and possibly a felony.

Does anyone have a better idea?

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