G
Guest
Normally, when i define a friend operator + the argument used by the
operator function is references. but i try to use pointer and look like
this:
class A;
friend A operator+( A *a1, A *a2);
I cannot pass through the compiler. get error c2803.
i look up the book<The C++ programming language> ,and i get the reason,
Pointers cannot be used because it is not possible to redefine the
meaning of
an operator applied to a pointer. i don't understand redefine, can you
tell me ,thanks.
operator function is references. but i try to use pointer and look like
this:
class A;
friend A operator+( A *a1, A *a2);
I cannot pass through the compiler. get error c2803.
i look up the book<The C++ programming language> ,and i get the reason,
Pointers cannot be used because it is not possible to redefine the
meaning of
an operator applied to a pointer. i don't understand redefine, can you
tell me ,thanks.