+ 7
How can one Overload Operators << and >> ?
2 Answers
0
Here is a simple example of turning a bitwise << into a + operator.
https://code.sololearn.com/c4j07QdkvFLA/#cpp
From "More On Classes, Operator Overloading", "Operators that can't be overloaded include :: | .* | . | ?: "
- 1
This operators are said to be bitwise operators and are listed among the many which cannot be overloaded. So, the language does not permit to overload this operators, doing which would result into an 'Compiler' error. The other operators which cannot be overloaded are ' . ' , ' : ? ' , etc.
Please do hit 'like', if you find the answer helpful!