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

#include "stdcomplex.h"

#include <iostream>

StdComplex::StdComplex() noexcept = default;

StdComplex::StdComplex(double re, double img) noexcept : m_impl(re, img)
{
}

StdComplex::StdComplex(const Impl &impl) noexcept : m_impl(impl)
{
}

std::ostream &operator<<(std::ostream &str, const StdComplex &c)
{
    str << "Complex(" << c.real() << ", " << c.imag() << ')';
    return str;
}