-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsum.cpp
More file actions
53 lines (47 loc) · 747 Bytes
/
Copy pathsum.cpp
File metadata and controls
53 lines (47 loc) · 747 Bytes
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "sum.hpp"
sum::sum(signal *x, signal *y)
{
setX(x);
setY(y);
}
sum::sum(sum &toCopy) noexcept : x{toCopy.getX()}, y{toCopy.getY()}
{
}
sum& sum::operator=(sum &toCopy) noexcept
{
this->setX(toCopy.getX());
this->setY(toCopy.getY());
return *this;
}
sum::sum(sum &&toMove) noexcept : x{std::move(toMove.getX())}, y{std::move(toMove.getY())}
{
}
sum& sum::operator=(sum &&toMove) noexcept
{
setX(std::move(toMove.getX()));
setY(std::move(toMove.getY()));
return *this;
}
sum::~sum()
{
}
std::complex<double> sum::get(long long int n)
{
return x->get(n)+y->get(n);
}
signal* sum::getX()
{
return x;
}
void sum::setX(signal *x)
{
this->x = x;
}
signal* sum::getY()
{
return y;
}
void sum::setY( signal *y)
{
this->y = y;
}