Comment Comment by lbrandy Indeed. Sorry OP, your solution:(1) avoids best practice (RAII) using...(2) a flawed rationale (ignoring the existence of compiler optimizations)...(3) without measurement to demonstrate the supposed flaw in the best practice (which would have surfaced the flawed rationale)...(4) and therefore implements a micro-optimization with no actual win...(5) and introduces a bug in the process (it's not exception safe). parent lbrandy 12 years ago
(1) avoids best practice (RAII) using...
(2) a flawed rationale (ignoring the existence of compiler optimizations)...
(3) without measurement to demonstrate the supposed flaw in the best practice (which would have surfaced the flawed rationale)...
(4) and therefore implements a micro-optimization with no actual win...
(5) and introduces a bug in the process (it's not exception safe).