2,063 karma · joined April 21, 2022
If some warnings are flaky then disable them specifically. In my experience most warnings in -Wall are OK and you can suppress the rare false positives in code. Don't suppress without a comment.
edit:
Having said that there are entirely valid reasons to not have -Werror outside of CI. It should be absolutely disabled by default if you distribute source.
<size_t ...Idxs> works because it introduces a pack that is a template parameter, so it naturally gets templated on the size of the pack (as well as on the values).
I guess an other historical issue for the grammar is that without the parameter name, `void foo(size_t ...)` is already valid grammar, and is equivalent to `void foo(size_t, ...)`, a C-style variadic.
https://cppinsights.io/lnk?code=dm9pZCBmb28oYXV0bykge30KCnZv...
Do blue leds consume significantly more power too for the same brightness, or only their voltage is higher?
https://godbolt.org/z/GMxz5c339
"sorry, unimplemented". It really felt out-of-place when I first encountered it, but I think it messages intent a bit more than a simple "unimplemented" error message. It at least suggests that this is a shortcoming of the current implementation, so it might get implemented in a later version.
Having said that clang also doesn't implement this, and the error message doesn't apologize: "error: cannot compile this lambda conversion to variadic function yet"
Having a NaN-like sentinel with is another option, with overflowing integer operations defaulting to that value instead, but that's not what is proposed here.
The post does mention optional<int>, which could have the NaN-like sentinel (empty optional) by reusing the bit-pattern of the trap representation of the underlying int.
That probably has the potential of having too many false positives. It's also very non-confroming, so I see why compiler vendors would be reluctant to add such a flag.
Having said that this should be a new type, adding more UB to existing types is a bad idea.
They are probably not looking for that, because LLMs perform poorly with some kind of problems, and you don't want people who rely on them heavily.
This gives you a plan for designing the interview questions.
I would say that the only thing that should be assumed implicitly is that it's forbidden to use the help of other people. Anything else should be explicitly laid out.
Having said that if some rule is not clear or evident then the interviewee should ask. And they should never be dishonest.
I wouldn't characterize this as a small amount of confidence, as conditional distribution of the mix-rate after the first sample drastically differs from the prior.
Originally each mix-rate has 1/101 probablity. After the sample having a mix with n reds in it has the probablity 2n/(100101).
I think we could do better, even in RGB by treating translucency as a 3x3 matrix instead of a single alpha scalar. Per-channel transparency could be represented by a diagonal matrix, but there is no reason that the current RGB basis would be adequate for representing transparent materials, hence the generalization to a 3x3 matrix.
Then a tint wouldn't need to be defined additively, a green tinted glass could simply not let most of red and blue through.
Having said that I agree that it's probably not worth it to put getpid() into vDSO.