I used inline in every method in my program (implementation of algorithm), does it can make problems?
I used inline in every method in my program (implementation of algorithm), does it
Share
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.
Depends on what your code looks like.
But not understanding what your code means? That is definitely going to cause you problems.
Why don’t you try to learn what
inlineactually does, rather than simply whether or not it’s going to cause any problems?The primary effect of the
inlinekeyword in C++ is to make the compiler suppress the ODR (One Definition Rule). So a non-inlinefunction must be defined in exactly one translation unit.An
inlinefunction must be defined in every translation where it’s used.So depending on how and where your function is defined,
inlinemay or may not be correct. I suggest you use it where its use is correct.