Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
Qt::partial_ordering Class Reference

\variable Qt::weak_ordering::less More...

#include <qcompare.h>

+ Collaboration diagram for Qt::partial_ordering:

Static Public Attributes

static const partial_ordering less
 
static const partial_ordering equivalent
 
static const partial_ordering greater
 
static const partial_ordering unordered
 

Friends

class weak_ordering
 
class strong_ordering
 
constexpr bool operator== (partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator!= (partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator< (partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator<= (partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator> (partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator>= (partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero) noexcept
 
constexpr bool operator== (QtPrivate::CompareAgainstLiteralZero, partial_ordering rhs) noexcept
 
constexpr bool operator!= (QtPrivate::CompareAgainstLiteralZero, partial_ordering rhs) noexcept
 
constexpr bool operator< (QtPrivate::CompareAgainstLiteralZero, partial_ordering rhs) noexcept
 
constexpr bool operator<= (QtPrivate::CompareAgainstLiteralZero, partial_ordering rhs) noexcept
 
constexpr bool operator> (QtPrivate::CompareAgainstLiteralZero, partial_ordering rhs) noexcept
 
constexpr bool operator>= (QtPrivate::CompareAgainstLiteralZero, partial_ordering rhs) noexcept
 
constexpr bool operator== (partial_ordering lhs, partial_ordering rhs) noexcept
 Return true if lhs and rhs represent the same result; otherwise, returns false.
 
constexpr bool operator!= (partial_ordering lhs, partial_ordering rhs) noexcept
 Return true if lhs and rhs represent different results; otherwise, returns true.
 
QT_WARNING_PUSH friend constexpr bool is_eq (partial_ordering o) noexcept
 
constexpr bool is_neq (partial_ordering o) noexcept
 
constexpr bool is_lt (partial_ordering o) noexcept
 
constexpr bool is_lteq (partial_ordering o) noexcept
 
constexpr bool is_gt (partial_ordering o) noexcept
 
constexpr bool is_gteq (partial_ordering o) noexcept
 

Related Symbols

(Note that these are not member symbols.)

bool operator== (Qt::partial_ordering lhs, QtPrivate::CompareAgainstLiteralZero)
 

Detailed Description

\variable Qt::weak_ordering::less

Represents the result of a comparison where the left operand is less than the right operand.

\variable Qt::weak_ordering::equivalent

Represents the result of a comparison where the left operand is equivalent to the right operand.

\variable Qt::weak_ordering::greater

Represents the result of a comparison where the left operand is greater than the right operand.

\inmodule QtCore

Qt::partial_ordering represents the result of a comparison that allows for unordered results.

See also
Qt::strong_ordering, Qt::weak_ordering, {Comparison types overview}
Since
6.7

A value of type Qt::partial_ordering is typically returned from a three-way comparison function. Such a function compares two objects, establishing whether they are ordered and, if so, their ordering. It uses this return type to indicate that the ordering is partial; that is, not all pairs of values are ordered.

Qt::partial_ordering has four values, represented by the following symbolic constants:

\list

  • \l less represents that the left operand is less than the right;
  • \l equivalent represents that the two operands are equivalent;
  • \l greater represents that the left operand is greater than the right;
  • \l unordered represents that the two operands are {not ordered}. \endlist

Qt::partial_ordering is idiomatically used by comparing an instance against a literal zero, for instance like this:

// given a, b, c, d as objects of some type that allows for a 3-way compare,
// and a compare function declared as follows:
Qt::partial_ordering compare(T lhs, T rhs); // defined out-of-line
~~~
Qt::partial_ordering result = compare(a, b);
if (result < 0) {
// a is less than b
}
if (compare(c, d) >= 0) {
// c is greater than or equal to d
}
\variable Qt::weak_ordering::less
Definition qcompare.h:66
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
const GLubyte * c
GLuint64EXT * result
[6]
static int compare(quint64 a, quint64 b)

Comparing Qt::partial_ordering::unordered against literal 0 always returns a false result.

Definition at line 65 of file qcompare.h.

Friends And Related Symbol Documentation

◆ is_eq

Qt::partial_ordering::is_eq ( Qt::partial_ordering o)
friend

Definition at line 199 of file qcompare.h.

◆ is_gt

Qt::partial_ordering::is_gt ( Qt::partial_ordering o)
friend

Definition at line 203 of file qcompare.h.

◆ is_gteq

Qt::partial_ordering::is_gteq ( Qt::partial_ordering o)
friend

is_eq_table

These functions are provided for compatibility with {std::partial_ordering}.

Definition at line 204 of file qcompare.h.

◆ is_lt

Qt::partial_ordering::is_lt ( Qt::partial_ordering o)
friend

Definition at line 201 of file qcompare.h.

◆ is_lteq

Qt::partial_ordering::is_lteq ( Qt::partial_ordering o)
friend

Definition at line 202 of file qcompare.h.

◆ is_neq

Qt::partial_ordering::is_neq ( Qt::partial_ordering o)
friend

Definition at line 200 of file qcompare.h.

◆ operator!= [1/3]

bool Qt::partial_ordering::operator!= ( Qt::partial_ordering lhs,
Qt::partial_ordering rhs )
friend

Return true if lhs and rhs represent different results; otherwise, returns true.

Definition at line 137 of file qcompare.h.

◆ operator!= [2/3]

constexpr bool operator!= ( partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 77 of file qcompare.h.

◆ operator!= [3/3]

constexpr bool operator!= ( QtPrivate::CompareAgainstLiteralZero ,
partial_ordering rhs )
friend

Definition at line 102 of file qcompare.h.

◆ operator< [1/2]

constexpr bool operator< ( partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 81 of file qcompare.h.

◆ operator< [2/2]

constexpr bool operator< ( QtPrivate::CompareAgainstLiteralZero ,
partial_ordering rhs )
friend

Definition at line 106 of file qcompare.h.

◆ operator<= [1/2]

constexpr bool operator<= ( partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 85 of file qcompare.h.

◆ operator<= [2/2]

constexpr bool operator<= ( QtPrivate::CompareAgainstLiteralZero ,
partial_ordering rhs )
friend

Definition at line 110 of file qcompare.h.

◆ operator== [1/4]

bool Qt::partial_ordering::operator== ( Qt::partial_ordering lhs,
Qt::partial_ordering rhs )
friend

Return true if lhs and rhs represent the same result; otherwise, returns false.

Definition at line 134 of file qcompare.h.

◆ operator== [2/4]

constexpr bool operator== ( partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 73 of file qcompare.h.

◆ operator==() [3/4]

bool operator== ( Qt::partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
related

◆ operator== [4/4]

constexpr bool operator== ( QtPrivate::CompareAgainstLiteralZero ,
partial_ordering rhs )
friend

Definition at line 98 of file qcompare.h.

◆ operator> [1/2]

constexpr bool operator> ( partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 89 of file qcompare.h.

◆ operator> [2/2]

constexpr bool operator> ( QtPrivate::CompareAgainstLiteralZero ,
partial_ordering rhs )
friend

Definition at line 114 of file qcompare.h.

◆ operator>= [1/2]

constexpr bool operator>= ( partial_ordering lhs,
QtPrivate::CompareAgainstLiteralZero  )
friend

Definition at line 93 of file qcompare.h.

◆ operator>= [2/2]

constexpr bool operator>= ( QtPrivate::CompareAgainstLiteralZero ,
partial_ordering rhs )
friend

Definition at line 118 of file qcompare.h.

◆ strong_ordering

friend class strong_ordering
friend

Definition at line 187 of file qcompare.h.

◆ weak_ordering

friend class weak_ordering
friend

Definition at line 186 of file qcompare.h.

Member Data Documentation

◆ equivalent

constexpr partial_ordering Qt::partial_ordering::equivalent
inlinestaticconstexpr

Definition at line 69 of file qcompare.h.

Referenced by Qt::compareThreeWay(), and QTestPrivate::testAllComparisonOperators().

◆ greater

constexpr partial_ordering Qt::partial_ordering::greater
inlinestaticconstexpr

Definition at line 70 of file qcompare.h.

Referenced by Qt::compareThreeWay().

◆ less

constexpr partial_ordering Qt::partial_ordering::less
inlinestaticconstexpr

Definition at line 68 of file qcompare.h.

Referenced by Qt::compareThreeWay(), and QTestPrivate::testAllComparisonOperators().

◆ unordered

constexpr partial_ordering Qt::partial_ordering::unordered
inlinestaticconstexpr

Definition at line 71 of file qcompare.h.

Referenced by Qt::compareThreeWay(), and QTestPrivate::testAllComparisonOperators().


The documentation for this class was generated from the following files: