|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2004-11-29 17:26:08
Peter, I've been expecting for some time that you were going to put the
placeholders in a sub-namespace of boost, if only to avoid the ODR
violations it is currently causing. No?
The fact that I have to write mpl::_1 just to avoid colliding with
<unnamed>::_1 is disconcerting at best. If another library came along
and did what boost/bind/placeholders.hpp does, it would cause a clash.
My suggestion, assuming you care about backwards compatibility, is:
boost/bind/placeholders.hpp
declares placeholders in namespace boost::bind::placeholders.
boost/bind/bind.hpp
has the current contents of boost/bind.hpp, except that
placeholders are not declared in the <unnamed>::
boost/bind.hpp
#include <boost/bind/bind.hpp>
#include <boost/bind/placeholders.hpp>
namespace { using namespace boost::bind::placeholders; }
Is something wrong with that?
-- Dave Abrahams Boost Consulting http://www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk