What causes C++ compiler error: must have argument of class or enumerated type?

前端 未结 3 1929
忘掉有多难
忘掉有多难 2020-12-20 14:38

Function declaration:


template 
Point* operator +(Point const * const point, Vector const * const vector);
         


        
3条回答
  •  [愿得一人]
    2020-12-20 15:06

    You can't overload operators for fundamental types, in your case both arguments are pointers. Did you want references instead?

提交回复
热议问题