|
Boost : |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2003-12-13 14:24:55
"Daniel Wallin" <dalwan01_at_[hidden]> wrote in message
news:3FDAF980.9040706_at_student.umu.se...
> David Abrahams wrote:
> > "Jonathan Turkanis" <technews_at_[hidden]> writes:
> >
> >
> >>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?
> >
> >
> > Bite the bullet and use qualification.
>
> Or just reuse bind's placeholders. Unless you need to add members
> to the placeholders of course..
>
Thanks.
I wouldn't want to define placeholders in an anonymous namespace like Bind.
To avoid pollution, I would define them in a namespace such as boost::xxx,
but allow users to make them accessible without qualification, if they want,
like so:
using boost::xxx::_1;
using boost::xxx::_2;
...
If users do the same with MPL, there will be a clash. MPL plcaeholders are
types, so they can't be reused if one needs placeholder objects. (I could
always make people write _1(), _2() :) )
Jonathan
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk