diff options
Diffstat (limited to 'sources/shiboken6/tests/libsample/complex.cpp')
-rw-r--r-- | sources/shiboken6/tests/libsample/complex.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sources/shiboken6/tests/libsample/complex.cpp b/sources/shiboken6/tests/libsample/complex.cpp index ce2c2b7de..e3bec9aae 100644 --- a/sources/shiboken6/tests/libsample/complex.cpp +++ b/sources/shiboken6/tests/libsample/complex.cpp @@ -1,18 +1,16 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 -#include <iostream> #include "complex.h" -using namespace std; +#include <iostream> -Complex::Complex(double real, double imag) +Complex::Complex(double real, double imag) noexcept : m_real(real), m_imag(imag) { } -Complex -Complex::operator+(Complex& other) +Complex Complex::operator+(const Complex &other) { Complex result; result.setReal(m_real + other.real()); @@ -20,10 +18,7 @@ Complex::operator+(Complex& other) return result; } -void -Complex::show() +void Complex::show() const { - cout << "(real: " << m_real << ", imag: " << m_imag << ")"; + std::cout << "(real: " << m_real << ", imag: " << m_imag << ")"; } - - |