logoalt Hacker News

on_the_trainyesterday at 7:26 PM3 repliesview on HN

But using the deref op is deliberately unsafe, and never used without a check in practice. This would neither pass a review, nor static analysis.


Replies

canypyesterday at 7:37 PM

GP picked the less useful of the two examples. The other one is a use-after-move, which static analysis won't catch beyond trivial cases where the relevant code is inside function scope.

I also agree with them: I am pro-C++ too, but the current standard is a fucking mess. Go and look at modules if you haven't, for example (don't).

mohinderyesterday at 7:59 PM

> This would neither pass a review, nor static analysis

I beg to differ. Humans are fallible. Static analysis of C++ cannot catch all cases and humans will often accept a change that passes the analyses.

show 1 reply
IshKebabyesterday at 8:24 PM

> never used without a check in practice

Ho ho ho good one.