Then, removing the #if !defined( BOOST_NO_CXX11_NULLPTR ) guard from the constructor of shared_ptr that accepts a boost::detail::sp_nullptr_t does indeed seem to work.
namespace boost {
namespace detail {
struct sp_nullptr_t {};
}
const detail::sp_nullptr_t nullptr = detail::sp_nullptr_t();
}
#include <boost/smart_ptr/shared_ptr.hpp>
int f(boost::shared_ptr<int> i) { return i ? *i : 0; }
int main()
{
f(boost::nullptr);
}
...there's probably some reason I'm not thinking of.