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

The inline keyword doesn’t do what most people think it does. Especially true with every compiler upgrade or platform change. One worse engine once summarized its user cases as twofold: first, to hide visibility when linking, second, to judge the engineering org’s maturity.


In C++ inline is sometimes needed to prevent ODR violations.


That's exactly why I included it. People automatically think inlining is my intention. In reality I avoid templates and not all of my code is in a class. It's short enough to be a candidate for inlining so I put it in a header.

I was hoping more comments would discuss this




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

Search: