I know compiler may or may not perform inline expansion of a function whether requested by the programmer or not.
I was just curious to know, is there any way by which programmer can know for sure that compiler has inlined a particular function?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Other than by looking at the generated code, no. Some implementations may provide that information but it’s not required by the standard.
Things like
inlineorregister(shudder) are suggestions to the compiler and it’s free to accept them, ignore them or even lie to you that it’s done it while secretly going behind your back and not doing it 🙂I tend not to use features like that since I suspect the compiler often knows better than I do how to wring the most performance out of my code.