Go to the documentation of this file.
28 #if !defined(MYSQLPP_TINY_INT_H)
29 #define MYSQLPP_TINY_INT_H
54 template <
typename VT =
signed char>
83 return static_cast<int>(value_);
159 value_ <<= static_cast<value_type>(v);
204 return value_ - i.value_;
210 return value_ + i.value_;
216 return value_ * i.value_;
222 return value_ / i.value_;
228 return value_ % i.value_;
234 return value_ | i.value_;
240 return value_ & i.value_;
246 return value_ ^ i.value_;
252 return value_ << i.value_;
258 return value_ >> i.value_;
264 return value_ == i.value_;
270 return value_ != i.value_;
276 return value_ < i.value_;
282 return value_ > i.value_;
288 return value_ <= i.value_;
294 return value_ >= i.value_;
302 template <
typename VT>
303 std::ostream& operator <<(std::ostream& os,
tiny_int<VT> i)
305 os << static_cast<int>(i);
this_type operator+(const this_type &i) const
Return this value plus i.
Definition: tiny_int.h:252
this_type & operator/=(int v)
Divide this value by another object.
Definition: tiny_int.h:165
this_type operator|(const this_type &i) const
Return this value bitwise OR'd by i.
Definition: tiny_int.h:276
this_type operator^(const this_type &i) const
Return this value bitwise XOR'd by i.
Definition: tiny_int.h:288
bool operator<(const this_type &i) const
Check that this object is less than another.
Definition: tiny_int.h:318
bool operator==(const this_type &i) const
Check for equality.
Definition: tiny_int.h:306
this_type & operator--()
Subtract one from this value and return that value.
Definition: tiny_int.h:222
this_type & operator-=(int v)
Subtract another value to this object.
Definition: tiny_int.h:151
this_type operator>>(const this_type &i) const
Return this value bitwise shifted right by i.
Definition: tiny_int.h:300
bool operator>=(const this_type &i) const
Check this object is greater than or equal to another.
Definition: tiny_int.h:336
bool operator>(const this_type &i) const
Check that this object is greater than another.
Definition: tiny_int.h:324
bool operator<=(const this_type &i) const
Check this object is less than or equal to another.
Definition: tiny_int.h:330
this_type & operator++()
Add one to this value and return that value.
Definition: tiny_int.h:215
this_type & operator=(int v)
Assign a new value to the object.
Definition: tiny_int.h:137
VT value_type
alias for type of internal value
Definition: tiny_int.h:104
this_type operator-(const this_type &i) const
Return this value minus i.
Definition: tiny_int.h:246
this_type operator/(const this_type &i) const
Return this value divided by i.
Definition: tiny_int.h:264
this_type operator<<(const this_type &i) const
Return this value bitwise shifted left by i.
Definition: tiny_int.h:294
this_type & operator*=(int v)
Multiply this value by another object.
Definition: tiny_int.h:158
this_type & operator>>=(int v)
Shift this value right by v positions.
Definition: tiny_int.h:208
this_type & operator&=(int v)
Bitwise AND this value by another value.
Definition: tiny_int.h:180
this_type operator*(const this_type &i) const
Return this value multiplied by i.
Definition: tiny_int.h:258
This file includes top-level definitions for use both internal to the library, and outside it....
tiny_int< VT > this_type
alias for this object's type
Definition: tiny_int.h:103
this_type & operator^=(int v)
Bitwise XOR this value by another value.
Definition: tiny_int.h:194
this_type & operator+=(int v)
Add another value to this object.
Definition: tiny_int.h:144
bool operator!=(const this_type &i) const
Check for inequality.
Definition: tiny_int.h:312
this_type & operator|=(int v)
Bitwise OR this value by another value.
Definition: tiny_int.h:187
this_type operator&(const this_type &i) const
Return this value bitwise AND'd by i.
Definition: tiny_int.h:282
tiny_int()
Default constructor.
Definition: tiny_int.h:109
this_type & operator%=(int v)
Divide this value by another object and store the remainder.
Definition: tiny_int.h:173
Class for holding an SQL TINYINT value.
Definition: tiny_int.h:77
this_type operator%(const this_type &i) const
Return the modulus of this value divided by i.
Definition: tiny_int.h:270
this_type & operator<<=(int v)
Shift this value left by v positions.
Definition: tiny_int.h:201