3 ms·
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 codeba
by bcrosby95 4y ago
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.