diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-08-07 12:29:21 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-08-17 11:31:28 +0000 |
commit | d26289ffb43a5fcf34e855db1dfbf42aa03c4f5a (patch) | |
tree | 5154f73b033c638e1929829698e9a4395b874417 /src/corelib/global/qendian.cpp | |
parent | d7fbc9ea883313ad19ff12318e8efb5deab6d439 (diff) |
Add ++/--/min/max to QSpecialInteger
Add both prefix and postfix versions of the increment/decrement
operators, and a static constexpr min/max which returns the
minimum/maximumm values that can be stored in the QSpecialInteger. These
latter functions are useful to define constants, e.g.:
typedef quint8_be IPv4_TTL;
static constexpr TTL_TO_DROP = IPv4_TTL::min();
Change-Id: I825a279feb68b93572765a9fdb5aa7b06d1be35b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qendian.cpp')
-rw-r--r-- | src/corelib/global/qendian.cpp | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/src/corelib/global/qendian.cpp b/src/corelib/global/qendian.cpp index 5bc5507dd5..7fd6e13d3b 100644 --- a/src/corelib/global/qendian.cpp +++ b/src/corelib/global/qendian.cpp @@ -433,6 +433,46 @@ QT_BEGIN_NAMESPACE */ /*! + \fn template <typename T> QLEInteger &QLEInteger<T>::operator++() + + Performs a prefix ++ (increment) on this QLEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QLEInteger QLEInteger<T>::operator++(int) + + Performs a postfix ++ (increment) on this QLEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QLEInteger &QLEInteger<T>::operator--() + + Performs a prefix -- (decrement) on this QLEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QLEInteger QLEInteger<T>::operator--(int) + + Performs a postfix -- (decrement) on this QLEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QLEInteger QLEInteger<T>::max() + + Returns the maximum (finite) value representable by the numeric type T. +*/ + +/*! + \fn template <typename T> QLEInteger QLEInteger<T>::min() + + Returns the minimum (finite) value representable by the numeric type T. +*/ + +/*! \class QBEInteger \inmodule QtCore \brief The QBEInteger class provides platform-independent big-endian integers. @@ -552,6 +592,46 @@ QT_BEGIN_NAMESPACE */ /*! + \fn template <typename T> QBEInteger &QBEInteger<T>::operator++() + + Performs a prefix ++ (increment) on this QBEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QBEInteger QBEInteger<T>::operator++(int) + + Performs a postfix ++ (increment) on this QBEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QBEInteger &QBEInteger<T>::operator--() + + Performs a prefix -- (decrement) on this QBEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QBEInteger QBEInteger<T>::operator--(int) + + Performs a postfix -- (decrement) on this QBEInteger and returns a reference to + this object. +*/ + +/*! + \fn template <typename T> QBEInteger QBEInteger<T>::max() + + Returns the maximum (finite) value representable by the numeric type T. +*/ + +/*! + \fn template <typename T> QBEInteger QBEInteger<T>::min() + + Returns the minimum (finite) value representable by the numeric type T. +*/ + +/*! \typedef quint16_le \relates <QtEndian> \since 5.10 |