Boost logo

Boost :

Subject: Re: [boost] Removing Bind placeholders from the global namespace
From: Joel de Guzman (joel_at_[hidden])
Date: 2009-06-14 22:41:04


Sohail Somani wrote:
> Peter Dimov wrote:
>> Sohail Somani:
>>> Why doesn't bind support the other placeholders instead?
>> It does.
>
> Through boost::is_placeholder<T>, I presume. That's reasonable. I still
> don't think that is enough to warrant mirroring std::placeholders in
> boost::placeholders.
>
> I don't think I have any more to say on the topic except what I have
> said so far. I guess you will know soon if I am the only one who feels
> this way :-)

Here are my thoughts:

* Put all common placeholders (i.e. we have _1... _N now) in
   boost::placeholders
* Make them library agnostic (they don't even have to rely
   on boost.proto nor boost.bind)
* Provide some necessary traits/functions for dealing
   with these placeholders. These should not be tied to any
   library (not proto, nor bind). boost::is_placeholder<T> is
   one such mechanism (what else?). Where is is_placeholder?
   if it is in boost.bind, it probably ought to be brought out
   on its own.

_1 + _1 is slippery. This, IMO, cannot be a Phoenix nor Lambda,
nor Bind expression. It has to be contaminated somehow to make
it one. Bind has no problems with it, but I do not see any
other solution at the moment for lambda and phoenix coexisting
at the same time other than to allow them to keep their native
placeholders in their own namespaces.

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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