4 ms·
> sometimes that’s actually what you meant — you’re calling it only for its side effect. Back in 2022, Stephan T. Lavavej estimated of unique_ptr::release that
by feelamee 10mo ago
> sometimes that’s actually what you meant — you’re calling it only for its side effect. Back in 2022, Stephan T. Lavavej estimated of unique_ptr::release that “90% of discards are a bug, but 10% are maybe valid…
What are these 10% valid cases? Does someone have an example
- quuxplusone 10mo agoHere's a made-up example, not from any particular codebase: try { f(p.get()); (void)p.release(); } catch (...) { /* f threw; don't release p after all */ }