I'm making a class for boolean expressions, a simpler version of bool.
I need three operators, one for AND, one for OR and one for NOT.
I can easily make + for OR, by overloading, but how can i declare . for AND and ' for NOT?
Can i even do this?
Thanks in advance
P.S, i'm a beginner :)
tayyabatiq
0
Newbie Poster
Recommended Answers
Jump to PostNo, you can't do this - . and ' aren't overloadable operators. You can overload & for AND and ! for NOT though (and make OR | while you're at it). That way the operators are also consistent with those of the builtin bool type.
PS: How exactly do you …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.