Subject: [boost] [placeholders]
From: Andrzej Krzemienski (akrzemi1_at_[hidden])
Date: 2010-07-27 11:41:37
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk