Hello. Studying the book of Bjarne Stroustrup, I came across an interesting, in my opinion, example:
class Tiny { char v; void assign(int i) { if(i&~077) // #1 throw Bad_range(); v = i; } public: class Bad_range{}; Tiny(int i) { assign(i); } Tiny& operator = (int i) { assign(i); return *this; } operator int() const { return v; } }; int main () { Tiny c1 = 2; Tiny c2 = 1; Tiny c3 = c1 - c2; // #2 } So, the first question (# 1), what is this condition, since I see it for the first time. And (# 2), the expression ( c1 - c2 ) will turn into int or Tiny ? And will there be a difference in performance, if you do not take into account the second question?