▲ | Disposal8433 5 days ago | |
What do you suggest? Some kind of std::const_reference<Type>? Clang-tidy is enough in addition to the reviews. | ||
▲ | eptcyka 5 days ago | parent | next [-] | |
The person is arguing that it is a massive difference, not a typo. I am saying that if that is the case, then maybe the hamming distance between correct and buggy code that both compile should be greater than 1, regardless if more tooling can help solve the problem or not. I specifically take issue with this framing of it is not an issue for we have the tools to help with this, especially where the tools are not part of a standard distribution of a toolchain and require more than minimal effort. C++ has had many a warts for many decades, and the response has always been *you are just holding it wrong* and not running a well covering integration test suite with sanitizers on every commit, you just need to run one more tool in the CI, just a comprehensive benchmarking suite, have more eyes looking for a single char difference in reviews. | ||
▲ | Mesopropithecus 5 days ago | parent | prev | next [-] | |
I'm seeing this way too often in production code, despite linters and reviews. So we have to keep plastering over. | ||
▲ | qalmakka 4 days ago | parent | prev [-] | |
The problem is not the reference, the problem is implicit copies and the horses left the barn 40 years ago, it's too late to fix that. The only thing we can do right now is deleting or marking copy constructors explicit whenever possible |