4 ms·
Zero cost compared to a raw pointer. You are comparing apple and oranges if you compare it to a regular variable. It has a null check on destructor (and a dele
by shultays 6y ago
Zero cost compared to a raw pointer. You are comparing apple and oranges if you compare it to a regular variable.
It has a null check on destructor (and a delete of course), which is good enough for "zero cost" to me
- shultays 6y agoHmm, now i thinked about this one but perhaps it is fair to compare unique_ptr to regular variables as well. I guess it is more complicated than i thought, but i think it is fair to compare them pointers too. Because most of the time you will probably need to store it as a pointer