Adding operator of boolean class

Pages: 12
However, I believe OP wanted to change things around:
maory wrote:
bool + bool = bool || bool.
I want to overload it, that it will be: bool && bool..


1 && 0 is 0 so OP presumably wants 1 + 0 = 0, not 1 + 0 = 1. I assume this is impossible - I tried overriding the + operator for booleans and it was not allowed.
But if you change the convention (negative logic)
true and false = false
true  +  false = false
0     +  1     = 1
Is there something wrong with a template specialization?
Ah, I missed the part about abusing common operators to mean something else...
Topic archived. No new replies allowed.
Pages: 12