#include #include using namespace boost; struct null_deleter { template void operator()(T) const { } }; int main() { boost::shared_ptr p(new int); boost::shared_ptr p_x = p; extern void (*function)(); boost::shared_ptr p2(function, null_deleter()); boost::shared_ptr p2_v = p2; return 0; }