Re: [C++] Obtain shared_ptr of an Array from a reference

2021-03-22 Thread Benjamin Kietzman
Would MakeArray(array.data()) work for you? On Mon, Mar 22, 2021, 23:00 Ying Zhou wrote: > Hi, > > I know this is a very silly question here but I still prefer to see it > resolved rather than working on it for a day: > > How shall I generate an std::shared_ptr from an Array&? Just taking > the

[C++] Obtain shared_ptr of an Array from a reference

2021-03-22 Thread Ying Zhou
Hi, I know this is a very silly question here but I still prefer to see it resolved rather than working on it for a day: How shall I generate an std::shared_ptr from an Array&? Just taking the address and constructing a shared_ptr from the pointer doesn’t work. Ying