I wonder about the multiply operation(*) is overloading in pointer or vice versa?
Or the operators are individual?
C++
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 works exactly like all of the operator symbols which can define a
unary or a binary operator (
+,-and&are the other ones), itdepends on the number of arguments the function will take. Thus, a
unary
*should be defined to take a single operator, either as anon-static class member taking no arguments (other than
this), or as afree function taking a single argument. The binary operator should be
defined to take two arguments, either as a non-static class member
taking one argument (in addition to
this), or a free function takingtwo arguments.
Note that the names of the functions are considered the same, so a
binary version can hide a unary one, or vice versa.