News for hackers. Stuff that matters.
Re:C++20 has been approved by shultays on Sunday September 06, 2020 @02:33PM (#24393546)
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

Re:C++20 has been approved by shultays on Sunday September 06, 2020 @03:02PM (#24393775)
Hmm, 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