Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

agreed, especially in cases like this. final is primarily a way to prohibit overriding methods and extending classes, and it indicates to the reader that they should not be doing this. use it when it makes conceptual sense.

that said, c++ is usually a language you use when you care about performance, at least to an extent. it's worth understanding features like nrvo and rewriting functions to allow the compiler to pick the optimization if it doesn't hurt readability too much.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: