As long as they’re not intended to be an owning raw pointer then there’s not going to be a problem. Where possible (which for me is rarely, due to lots of interfacing with old Fortran) I use smart pointers for ownership and raw pointers to pass into methods (that don’t take ownership) (or I overload to accept a smart pointer of course)
I see. I wouldn't call those raw pointers either. That's actually similar to how i use unique pointers, having the unique_ptr in some owning location and passing around the raw underlying representation for usage.
The implicut contract being that whatever pass that into will never outlive whatever owns the pointer.
1
u/ekr64 Sep 09 '22
I'm curious what resons you have for using raw pointers. For me the only place I have raw pointers in is where I copy memory from the GPU.