Re:We rewrote a high-performance database in Rust
by bcrosby95 on Tuesday October 18, 2022 @06:04PM
(#33254662)
One thing off the top of my head, from experience:
std::string s(s);
To be fair, compilers will warn you about this nowadays. But when I converted a C codebase to C++ 20 years ago they didn't.
IIRC, references can also refer to de-allocated memory. Also, if you don't pass-by-reference or pointer, you can literally "slice" the dynamic doohickies off your instance so your AlbinoCat behaves like a Cat because all that extra special stuff is gone as far as the function is concerned.
This is just off the top of my head after not working with C++ for 20 years. I'm sure with all the new features it's gained over the past 20 years theres whole new exciting ways to blow your leg off.
std::string s(s);
To be fair, compilers will warn you about this nowadays. But when I converted a C codebase to C++ 20 years ago they didn't.
IIRC, references can also refer to de-allocated memory. Also, if you don't pass-by-reference or pointer, you can literally "slice" the dynamic doohickies off your instance so your AlbinoCat behaves like a Cat because all that extra special stuff is gone as far as the function is concerned.
This is just off the top of my head after not working with C++ for 20 years. I'm sure with all the new features it's gained over the past 20 years theres whole new exciting ways to blow your leg off.