ENH Uses unique pointers#10
ENH Uses unique pointers#10jjerphan merged 2 commits intojjerphan:pairwise-distances-radius-neighborhoodfrom
Conversation
|
Thank you for the two suggestions, @thomasjpfan. |
|
In fact item 13 is a move constructor which must take a r-value reference (see the We get a compile error because we aren't using r-value here, but Is this right or am I missing something? I will just revert for now to have the CI pass on the original PR, still I am interested in pursuing the discussions here, @thomasjpfan. |
|
Yes you are correct. My mental model was incorrect about the interaction between shared + unique pointers. Everything needs to be shared here. For the casting to work, we would need to move it. |
|
That was an opportunity for me to learn as well. :) |
neigh_distancesandneigh_indicescan be a unique pointer.The shared_ptr constructor allows casting from unique to shared (item 13).
CC @jjerphan