Is there any difference in performance – or otherwise – between:
ptr->a();
and
(*ptr).a();
?
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.
Since you are asking for it in the comments. What you are probably looking for can be found in the Standard (5.2.5 Class member access):
The compiler will produce the exact same instructions and it will be just as efficient. Your machine will not know if you wrote “->” or “*.”.