-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbalance.cpp
More file actions
38 lines (31 loc) · 706 Bytes
/
balance.cpp
File metadata and controls
38 lines (31 loc) · 706 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
#include "balance.h"
#include "helper.h"
#include <cassert>
#include <cmath>
#include <iostream>
ribi::imcw::balance::balance(
const std::string& description,
const money& initial_value
) : m_description{description},
m_value{initial_value}
{
}
std::ostream& ribi::imcw::operator<<(std::ostream& os, const balance& b) noexcept
{
os
<< b.get_description() << ", value: "
<< b.get_value()
;
return os;
}
bool ribi::imcw::operator==(const balance& a, const balance& b) noexcept
{
return
a.get_description() == b.get_description()
&& a.get_value() == b.get_value()
;
}
bool ribi::imcw::operator!=(const balance& a, const balance& b) noexcept
{
return !(a == b);
}