#define a special operator in c++
问题 Say that I want to make up a special operator !+ in C++ between two objects. I would like to use !+, on example, because I think it is much more meaningful than any other operator. One basic thing I could do is to find a free, unused operator and make the replacement work with a #define: #define !+ % class myclass { public: int operator %(myclass &c) { return 3; } } So that if I later write something like a!+b with a and b instances of myclass, it would work. Now, is there any way to define