Can I create a new operator in C++ and how?

前端 未结 9 962
耶瑟儿~
耶瑟儿~ 2020-11-27 18:43

MATLAB arrays support matrix operations and element operations. For example, M*N and M.*N. This is a quite intuitive way to distinguish ‎the two di

9条回答
  •  半阙折子戏
    2020-11-27 18:47

    As other answers say, overloading operator.* is not possible.

    But I got a good solution for your question, check here.

    You can provide any methods in operator-ish form like:

    M  N
    

提交回复
热议问题