
On 7/27/2010 11:41 PM, Andrzej Krzemienski wrote:
Hi, I have a problem with Boost.Bind placeholders. Namely, once I include the<boost/bind.hpp> it automatically brings placeholders _1, _2, .. into scope and I cannot use placeholders from other libraries like Spirit.Qi any more. I.e. I can but I need to qualify them like qi::_1, qi::_2, which is annoying. I include<boost/bind.hpp> in a precompiled header, so I have no option of not including it. Boost.Bind could define them in namespace boost::bind_placeholders and we could control their visibility with namespace using directive. This is what Spirit does, and it is cute. I guess I would not be able to convince anyone that Bind should do the same. But would it be possible to define placeholders _1, _2, ... as something more generic in Boost, unrelated to any particular library? Then boost::bind, would treat it as its own placeholders, Spirit semantic actions would treat them as its own placeholders, but they would be exactly same placeholders.
Yes, it is possible. That is what we are trying to solve with the Phoenix-3 project: unification of all placeholders. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net