I'm not able to understand the boost documentation on how to use make_shared
and allocate_shared
to initialize shared arrays and pointers:
shared_ptr<int> p_int(new int); // OK
shared_ptr<int> p_int2 = make_shared<int>(); // OK
shared_ptr<int> p_int3 = allocate_shared(int); // ??
shared_array<int> sh_arr(new int[30]); // OK
shared_array<int> sh_arr2 = make_shared<int[]>(30); // ??
shared_array<int> sh_arr3 = allocate_shared<int[]>(30); // ??
I'm trying to learn the correct syntax to initialize the above variables commented as // ??