aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/spaceship.cpp
blob: b30f2f30f5ed16c1db2f374d3a2d644b451d71e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "spaceship.h"

SpaceshipComparisonTester::SpaceshipComparisonTester(int v) noexcept
    : m_value(v)
{
}

FreeSpaceshipComparisonTester::FreeSpaceshipComparisonTester(int v) noexcept
    : m_value(v)
{
}

int FreeSpaceshipComparisonTester::value() const
{
    return m_value;
}

#if __cplusplus >= 202002 || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002)
std::strong_ordering operator<=>(FreeSpaceshipComparisonTester lhs,
                                 FreeSpaceshipComparisonTester rhs)
{
    return lhs.value() <=> rhs.value();
}
#endif // C++ 20