self& operator<<=(int x) { assign(m << x); return *this; }
// унарные операторы
self operator-() { return self(-m); }
self operator+() { return self(-m); }
self operator!() { return self(!m); }
self operator~() { return self(~m); }
// бинарные операторы
friend self operator+(self x, const value_type& y) { return x += y; }
friend self operator-(self x, const value_type& y) { return x -= y; }
friend self operator*(self x, const value_type& y) { return x *= y; }
friend self operator/{self x, const value_type& y) { return x /= y; }
friend self operator%(self x, const value_type& y) { return x %= y; }
friend self operator+(const value_type& y, self x) { return x += y; }
friend self operator-(const value_type& y, self x) { return x -= y; }
friend self operator*(const value_type& y, self x) { return x *= y; }
friend self operator/(const value_type& y, self x) { return x /= y; }
friend self operator%(const value_type& y, self x) { return x %= y; }
friend self operator>>(self x, int y) { return x >>= y; }
friend self operator<<(self x, int y) { return x <<= y; }
// потоковые операторы
friend ostream& operator<<(ostream& o, self x) { о << x.m; return o; }
friend istream& operator>>(istream& i, self x) {
value_type tmp; i >> tmp; x.assign(tmp); return i;
}
// операторы сравнения
friend bool operator<(const self& x, const self& y) { return x.m < y.m; }
friend bool operator>(const self& x, const self& y) { return x.m > y.m; }
friend bool operator<=(const self& x, const self& y) { return x.m <= y.m; }
friend bool operator>=(const self& x, const self& y) { return x.m >= y.m; }
friend bool operator==(const self& x, const self& y) { return x.m == y.m; }