allocate_sharedused the same way make_sharedexcept that you pass the dispenser as the first argument.
boost::shared_ptr<int> p_int(new int);
boost::shared_ptr<int> p_int2 = boost::make_shared<int>();
MyAllocator<int> alloc;
boost::shared_ptr<int> p_int3 = boost::allocate_shared<int>(alloc);
There is no function makefor boost::shared_array, so the only way to do this is to manually allocate memory:
boost::shared_array<int> sh_arr(new int[30]);
boost::make_shared .. - , - boost::shared_ptr:
boost::shared_ptr<int[]> sh_arr2 = boost::make_shared<int[]>(30);
boost::shared_ptr<int[30]> sh_arr3 = boost::make_shared<int[30]>();
, std::shared_ptr .