3 ms·
std::unique_ptr::release() resets the ptr to nullptr, which will be the first thing the deleter will check for and bail out. This is a non-issue.
by aaaaaaaaaaab 4y ago
std::unique_ptr::release() resets the ptr to nullptr, which will be the first thing the deleter will check for and bail out.
This is a non-issue.
- dataflow 4y ago> which will be the first thing the deleter will check for and bail out. The point is that check itself is an extra instruction (or two, rather) that would otherwise be skipped entirely. I'm not saying this commonly makes a difference. I'm just saying this might be something that does make a difference for them in their particular use case. Also note that I was trying to describe the general phenomenon with a simple example, but this obviously isn't limited to std::unique_ptr.