이 페이지에서

Qt::weak_ordering Class

class Qt::weak_ordering

Qt::weak_ordering 동등한 값이라도 여전히 구별할 수 있는 경우를 나타냅니다. 더 보기...

헤더: #include <QtCompare>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
다음부터: Qt 6.7부터

공개 함수

weak_ordering(std::weak_ordering stdorder)
operator Qt::partial_ordering() const
operator std::weak_ordering() const

정적 공용 멤버

const Qt::weak_ordering equivalent
const Qt::weak_ordering greater
const Qt::weak_ordering less
bool is_eq(Qt::weak_ordering o)
bool is_gt(Qt::weak_ordering o)
bool is_gteq(Qt::weak_ordering o)
bool is_lt(Qt::weak_ordering o)
bool is_lteq(Qt::weak_ordering o)
bool is_neq(Qt::weak_ordering o)
bool operator!=(Qt::weak_ordering lhs, Qt::weak_ordering rhs)
bool operator==(Qt::weak_ordering lhs, Qt::weak_ordering rhs)

상세 설명

Qt::weak_ordering 유형의 값은 일반적으로 3자 비교 함수에서 반환됩니다. 이러한 함수는 두 객체를 비교하여 그 순서를 결정합니다. 이 반환 유형을 사용하여 순서가 약하다는 것을 나타냅니다. 즉, 동등한 값이라도 구별될 수 있습니다.

Qt::weak_ordering 다음의 기호 상수로 표현되는 세 가지 값을 가집니다:

  • less 는 왼쪽 피연산자가 오른쪽 피연산자보다 작음을 나타냅니다;
  • equivalent 왼쪽 피연산자가 오른쪽 피연산자와 동등함을 나타냅니다;
  • greater 왼쪽 피연산자가 오른쪽 피연산자보다 크음을 나타내며,

Qt::weak_ordering 관례적으로 인스턴스를 리터럴 0과 비교할 때 사용되며, 예를 들면 다음과 같습니다:

// 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::weak_ordering compare(T lhs, T rhs); // defined out-of-line
~~~

Qt::weak_ordering result = compare(a, b);
if (result < 0) {
    // a is less than b
}

if (compare(c, d) >= 0) {
    // c is greater than or equivalent to d
}

Qt::strong_ordering, Qt::partial_ordering 및 비교 유형 개요도참조하십시오 .

멤버 함수 문서

[constexpr noexcept] weak_ordering::weak_ordering(std::weak_ordering stdorder)

다음 규칙에 따라 ` stdorder `를 사용하여 ` Qt::weak_ordering ` 객체를 생성합니다.

  • std::weak_ordering::less는 less 로 변환됩니다.
  • std::weak_ordering::equivalent는 equivalent 로 변환됩니다.
  • std::weak_ordering::greater는 greater 로 변환됩니다.

[constexpr noexcept] weak_ordering::operator Qt::partial_ordering() const

다음 규칙에 따라 이 Qt::weak_ordering 값을 Qt::partial_ordering 객체로 변환합니다:

[constexpr noexcept] weak_ordering::operator std::weak_ordering() const

다음 규칙에 따라 이 ` Qt::weak_ordering ` 값을 `std::weak_ordering` 객체로 변환합니다:

  • less std::weak_ordering::less로 변환합니다.
  • equivalent std::weak_ordering::equivalent로 변환합니다.
  • greater std::weak_ordering::greater로 변환합니다.

멤버 변수 설명

const Qt::weak_ordering weak_ordering::equivalent

왼쪽 피연산자와 오른쪽 피연산자가 동일하다는 것을 나타내는 비교 결과입니다.

const Qt::weak_ordering weak_ordering::greater

왼쪽 피연산자가 오른쪽 피연산자보다 큰 비교 결과를 나타냅니다.

const Qt::weak_ordering weak_ordering::less

왼쪽 피연산자가 오른쪽 피연산자보다 작을 때의 비교 결과를 나타냅니다.

관련 비회원

[constexpr noexcept] bool is_eq(Qt::weak_ordering o)

[constexpr noexcept] bool is_gt(Qt::weak_ordering o)

[constexpr noexcept] bool is_gteq(Qt::weak_ordering o)

[constexpr noexcept] bool is_lt(Qt::weak_ordering o)

[constexpr noexcept] bool is_lteq(Qt::weak_ordering o)

[constexpr noexcept] bool is_neq(Qt::weak_ordering o)

o 를 다음 여섯 가지 관계 연산자 중 하나의 결과로 변환합니다:

함수연산
is_eqo == 0
is_neqo != 0
is_lto < 0
is_lteqo <= 0
is_gto > 0
is_gteqo >= 0

이 함수들은 std::weak_ordering 와의 호환성을 위해 제공됩니다.

[constexpr noexcept] bool operator!=(Qt::weak_ordering lhs, Qt::weak_ordering rhs)

lhs 와 rhs 가 서로 다른 결과를 나타내는 경우 true를 반환하고, 그렇지 않은 경우 true를 반환합니다.

[constexpr noexcept] bool operator==(Qt::weak_ordering lhs, Qt::weak_ordering rhs)

lhs 와 rhs 가 동일한 결과를 나타내는 경우 true를 반환하고, 그렇지 않은 경우 false를 반환합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.