KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
According to the wikipedia C++ article C++ is designed to give the programmer choice, even if this makes it possible for the programmer to choose incorrectly. If it is designed this way why there is no standard way to force the compiler to inline something even if I might be wrong? Or I can ask why is inline keyword is just a hint? I think I have no choice here. In the OOP world we call methods on the objects and directly accessing members should be avoided. If we can't force the accessors to be inlined, then we are unable to write high performance but still maintainable applications. (I know many compilers implement their own way to force inlining but it's ugly. Using macros to make inline accessors on a class are ugly too.) Does the compiler always do it better than the programmer?
Tags (comma-separated)
Save Edits
Cancel