4 ms·
I disagree. I have 16 years' experience programming in C++ (and substantial experience in other languages before that), and I find that an important factor in c
by jblow 14y ago
I disagree. I have 16 years' experience programming in C++ (and substantial experience in other languages before that), and I find that an important factor in code clarity is not writing stuff like this.
Yes, you can understand it, but it takes more brainpower to do so than it should, especially once you get beyond trivial cases. It is much better just to write it the long way.
- stephencanon 14y ago> I have 16 years' experience programming in C++ < Well, there you go; this is absolutely not idiomatic C++; in C++ (or even in application-level C code) one would (correctly) use language features or a library call to perform this copy. I should have been more specific; this code is completely idiomatic for standard-library-level C (though standard libraries will generally use more sophisticated copy implementations). If one is fluent in that particular dialect of the C language, then this construct is natural and correct.