Re:C++ Papercuts
by gpderetta on Monday August 28, 2023 @10:10AM
(#37294247)
If you pass a pointer (or anything with reference semantics) by value you can still get non local mutation through it without obvious call site syntax.
There is no perfect solution. Avoid out parameters if possible, otherwise make the semantics clear via function naming or at least parameter naming conventions.
There is no perfect solution. Avoid out parameters if possible, otherwise make the semantics clear via function naming or at least parameter naming conventions.