3 ms·
One of the best things to happen to C++ discussions was people starting to write godbolt links for their code. Immediately the code being discussed becomes code
by tialaramex 5y ago
One of the best things to happen to C++ discussions was people starting to write godbolt links for their code. Immediately the code being discussed becomes code somebody actually compiled and maybe tried running and not just "oh, ignore the fact it's syntactically invalid - you know what I meant". No we don't.
You can obviously write a godbolt link for Rust too, but Rust's playground is also a reasonable choice.
I think that code maybe makes more sense with a turbofish for each parse call and type inference, but maybe that's just a matter of taste. If the author had used godbolt or playground or whatever they'd have written code that compiles and we'd not be guessing.