QBEInteger

QBEInteger 

#include <QBEInteger>

 

 

Public Functions

  QBEInteger(T value)
T operator T() const
bool operator!=(QBEInteger<T> other) const
QBEInteger<T> & operator%=(T i)
QBEInteger<T> & operator&=(T i)
QBEInteger<T> & operator*=(T i)
QBEInteger<T> & operator+=(T i)
QBEInteger<T> & operator-=(T i)
QBEInteger<T> & operator/=(T i)
QBEInteger<T> & operator<<=(T i)
QBEInteger<T> & operator=(T i)
bool operator==(QBEInteger<T> other) const
QBEInteger<T> & operator>>=(T i)
QBEInteger<T> & operator^=(T i)
QBEInteger<T> & operator|=(T i)

Detailed Description

The QBEInteger class provides platform-independent big-endian integers.

The template parameter T must be a C++ integer type:

  • 8-bit: char, signed char, unsigned char, qint8, quint8
  • 16-bit: short, unsigned short, qint16, quint16, char16_t (C++11)
  • 32-bit: int, unsigned int, qint32, quint32, char32_t (C++11)
  • 64-bit: long long, unsigned long long, qint64, quint64
  • platform-specific size: long, unsigned long
  • pointer size: qintptr, quintptr, qptrdiff

Note: Using this class may be slower than using native integers, so only use it when an exact endian is needed.

Member Function Documentation

QBEInteger::QBEInteger(value)

Constructs a QBEInteger with the given value.

T QBEInteger::operator T() const

Returns the value of this QBEInteger as a native integer.

bool QBEInteger::operator!=(QBEInteger<T> other) const

Returns true if the value of this QBEInteger is not equal to the value of other.

QBEInteger<T> &QBEInteger::operator%=(i)

Sets this QBEInteger to the remainder of a division by i and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator&=(i)

Performs a bitwise AND with i onto this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator*=(i)

Multiplies i with this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator+=(i)

Adds i to this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator-=(i)

Subtracts i from this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator/=(i)

Divides this QBEInteger with i and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator<<=(i)

Performs a right-shift by i on this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator=(i)

Assigns i to this QBEInteger and returns a reference to this QBEInteger.

bool QBEInteger::operator==(QBEInteger<T> other) const

Returns true if the value of this QBEInteger is equal to the value of other.

QBEInteger<T> &QBEInteger::operator>>=(i)

Performs a left-shift by i on this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator^=(i)

Performs a bitwise XOR with i onto this QBEInteger and returns a reference to this object.

QBEInteger<T> &QBEInteger::operator|=(i)

Performs a bitwise OR with i onto this QBEInteger and returns a reference to this object.

 

 

 

 

 

##############################

原文链接: https://www.cnblogs.com/herd/p/17035961.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    QBEInteger

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/310733

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月16日 上午11:42
下一篇 2023年2月16日 上午11:43

相关推荐