2 ms·
> avoids having to check for nullptr You don't have to check for nullptr. It's the caller's job to adhere to the function contract. A function's caller can scr
by quotemstr 5y ago
> avoids having to check for nullptr
You don't have to check for nullptr. It's the caller's job to adhere to the function contract. A function's caller can screw up in a thousand different ways: why check at runtime for one of those ways?
> by smart ptr
Unnecessary heap allocation (which is what you get with a scheme that forces passing of out parameters via smart pointer) is a bad thing.