@cmuratori I tried this out for myself and I think they mean that the compiler split out an error when you do *x=9 inside the function.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@cmuratori but if you have blah(int* x) and inside the function you do *x=9; the compiler won't catch it as in an error and it will crash.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@cmuratori so doing blah(int &x) is "safe" but really who cares? I have never done *x = 0x000000; for any reason in a function.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@cmuratori oops I mean x=0; in the blah(int *x) it still would crash, unless you do *x=0x90; as well.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@cmuratori Bravo! Pretty much my position. Also, C++ semantics make it hard to reason cbv vs cbr from looking at the call site.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@cmuratori static code analysis will also catch your bugs in either case, and beats human code reviewers, so everyone should just use it!Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@cmuratori think idea is not to introduce ptrs just to perform mutation in the first place, so more code stays in 1st scenario as defaultThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.