Can I write
bool v1, v2;
// ...
EDIT: I am very sorry for the confusions. The correct statement should be:
bool v3 = !v1 ? v2 : !v2;
ORIGINAL I asked for
bool v3 = v1 ? v2 : !v2;
even shorter? Or: Is there an operator which will have the same result?
So I marked Anders Abels answer as correct, because he answered my initial question. I only need to invert his answer.
I think v1==v2
should do it.
Edit:
For the updated question, it's v1!=v2
, or v1^v2
as Anders said.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With