If I have a C++ class which contains a static member variable, does the accessor method for this variable need to be static as well? Also, are there any issues that might occur if I inline this method?
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.
It doesn’t need to be static, but unless it’s doing something specific to a particular instance of the class, there’s no real reason not to make it static anyway.
This shouldn’t effect inlining in any way.