進來金合發贏大獎👉

ui星博娛樂nt128_t 增添 c++ 重載類型強迫轉換

類型聲明:

 1 class uint128
 2 {
 3 public:
 4    uint128() :hi(0),lo(0){}
 5    uint128(uint32_t l) :hi(0),lo(l){}
 6    uint128(int32_t l) :hi(-(l < 0)),lo(l){}
 7    uint128(int64_t l) :hi(-(l < 0)),lo(l){}
 8    uint128(uint64_t l) :hi(0),lo(l){}
 9    地下539公式		uint128(const std::string& s);
10    uint128(uint64_t _h,uint64_t _l)
11       :hi(_h),lo(_l){}
12 
13 
14    bool     operator == (const uint128& o)const{ return hi == o.hi && lo == o.lo; }
15    bool六合彩玩法规则		     operator != (const uint128& o)const{ return hi != o.hi || lo != o.lo; }
16    bool     operator < (const uint128& o)const { return (hi == o.hi) ? lo < o.lo : hi < o.hi; }
17    bool     operator < (const int64_t& o)const { return *this < uint128(o); }
18    bool     operator !()const                    { return !(hi != 0 || lo != 0); }
19    uint128  operator -()const                    { return ++uint128(~hi,~lo); }
20    uint128  operator ~()const                    { return uint128(~hi,~lo); }
21 
22    uint128& operator++()    { hi += (++lo == 0); return *this; }
23    uint128& operator--()    { hi -= (lo-- == 0); return *this; }
24    uint128  operator++(int) { auto tmp = *this; ++(*this); return tmp; }
25    uint128  operator--(int) { auto tmp = *this; --(*this); return tmp; }
26 
27    uint128& operator |= (const uint128& u) { hi |= u.hi; lo |= u.lo; return *this; }
28    uint128& operator &= (const uint128& u娛樂城體驗金) { hi &= u.hi; lo &= u.lo; return *this; }
29    uint128& operator ^= (const uint128& u) { hi ^= u.hi; lo ^= u.lo; return *this; }
30    uint128& operator <>= (const uint128& u);
32 
33    uint128& operator += (const uint128& u) { const uint64_t old = lo; lo += u.lo;  hi += u.hi + (lo < old); return *this; }
34    uint128& operator -= (const uint128& u) { return *this += -u; }
35    uint128& operator *= (const uint娛樂城128& u);
36 
37 
38    friend uint128 operator + (const uint128& l,const uint1中華職棒即時比分		28& r)   { return娛樂城註冊送 uint128(l) += r; }
39    friend uint128 operator + (const uint128& l,const uint64_t& r)   { return uint128(l) += uint128(r); }
40    friend uint128 operator + (const uint128& l,const uint32_t& r)   { return uint128(l) += uint128(r); }
41    friend uint128 operator + (const uint128& l,const int32_t& r)   { return uint128(l) += uint128(r); }
42    friend uint128 operator + (const uint64_t& l,const uint128& r)   { return uint128(l) += r; }
43    friend uint128 operator - (const uint128& l,const uint128& r)   { return uint1娛樂城推薦28(l) -= r; }
44    friend uint128 operator * (const uint128& l,const uint128& r)   { return uint128(l) *= r; }
45    friend uint128 operator * (const uint128& l,const uint64_t& r)   { return uint128(l) *= uint128(r); }
46    friend uint128 operator * (const uint128& l,const uint32_t& r)   { return uint128(l) *= uint128(r); }
47    friend uint128 operator | (const uint128& l,const uint128& r)   { return uint128(l) = (r); }
48    friend uint128 operator & (const uint128& l,const uint128& r)   { return uint128(l) &= r; }
49    friend uint128 operator & (const uint128& l,const uint64_t& r)   { return uint128(l) &= uint128(r); }
50    friend uint128 operator ^ (const uint128& l,const uint128& r)   { return uint128(l) ^= r; }
51    friend uint128 operator << (const uint128& l,const uint128& r)  { return uint128(l) <> (const uint128& l,const uint128& r)  { return uint128(l) >>= r; }
53    friend uint128 opera娛樂城ptttor >> (const uint128& l,const int32_t& r)  { return uint128(l) >>= uint128(r); }
54    friend bool    operator >  (const uint128& l,const uint128& r)  { return r (const uint128& l,const int64_t& r)  { return uint128(r)   (const int64_t& l,const uint128& r)  { return r =  (const uint128& l,const uint128& r) { return l == r || l > r; }
59    friend bool    operator >=  (const uint128& l,const int64_t& r) { return l >= uint128(r); }
60    friend bool    operator >=  (const int64_t& l,const uint128& r) { return uint128(l) >= r; }
61    friend bool    operator <=  (const uint128& l,const uint128& r) { return l == r || l < r; }
62    friend bool    operator <=  (const uint128& l,const int64_t& r) { return l <= uint128(r); }
63    friend bool    operator <=  (const int64_t& l,const uint128& r) { return uint128(l) <= r; }
64 
65    operator uint64_t() { return lo; }               //逼迫轉換為uint64_t
66    operator uint32_t() { return (uint32_t)lo; }     //逼迫轉換為uint32_t
67    operator int32_t() { return (int32_t)lo; }       //逼迫轉換為int32_t
68 
69 
70    uint32_t low_32_bits()const { return (uint32_t)lo; }
71    uint64_t low_bits()const  { return lo; }
72    uint64_t high_bits()const { return hi; }
73 
74    uint64_t hi;
75    uint64_t lo;
76 };

?

【免責聲明】本站內容轉載自互聯網,其相干談吐僅代表作者小我不雅點盡非威望,不代表本站立場。如您發明內容存在版權題目,請提交相干鏈接至郵箱:,我們將實時予以處置。