Boost logo

Boost :

Subject: Re: [boost] Removing Bind placeholders from the global namespace
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-06-15 11:30:38


Joel de Guzman wrote:
> 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.

I think this is what Peter was planning on doing. is_placeholder is
independent of bind afaik.

> _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.

Have a chosen existing placeholder library put into boost::placeholders.
I think this is the "worse is better" solution. Then have the libraries
support these placeholders. I don't know how stuff like _1 >>
some_other_proto_grammar_thingy would work.

-- 
Sohail Somani
http://uint32t.blogspot.com

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