aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/intwrapper.cpp
blob: 0eaf3046536fe72374decbb21a3c126434f3eed5 (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
28
29
30
31
32
33
34
35
36
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0


#include "intwrapper.h"

int IntWrapper::toInt() const
{
    return m_number;
}

IntWrapper &IntWrapper::operator ++()
{
    ++m_number;
    return *this;
}

IntWrapper IntWrapper::operator++(int)
{
    IntWrapper result(*this);
    ++m_number;
    return result;
}

IntWrapper &IntWrapper::operator--()
{
    --m_number;
    return *this;
}

IntWrapper IntWrapper::operator--(int)
{
    IntWrapper result(*this);
    --m_number;
    return result;
}