Custom Operator?

Is it possible to create your own operators? (eg. +, -, *, /, etc. )

Thanks in advance,
CheesyBeefy
You can't create new operators that work on normal types (int bool etc), but you can overload the existing +, - etc operators.

http://www.cplusplus.com/doc/tutorial/classes2.html

You can create new operators for your custom classes however.
Last edited on
Operator overloading is also valid for enums
Topic archived. No new replies allowed.