Wednesday, October 2, 2013

C++. How to inherit operators from int?

The short answer - nohow.
But still, exists way to use int operators for your class.
It could be reached by defining implicit convertion operator to int.
Below here is demonstrative example of implementation which is useless in real programs.
 

No comments:

Post a Comment