-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresult.cpp
More file actions
43 lines (36 loc) · 721 Bytes
/
result.cpp
File metadata and controls
43 lines (36 loc) · 721 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
#include "pch.h"
#include "result.h"
namespace ocr
{
result::result()
{}
result::result(char _c)
: c(_c), val(0) {}
result::result(char _c, double _val)
: c(_c), val(_val) {}
bool result::operator<(const result& other) const
{
return val < other.val;
}
bool result::operator>(const result& other) const
{
return val > other.val;
}
result& result::operator=(const result& other)
{
c = other.c;
val = other.val;
return *this;
}
result& result::operator+=(const double& _val)
{
val += _val;
return *this;
}
}
std::ostream& operator<<(std::ostream& os, const ocr::result& res)
{
os << std::fixed << std::setprecision(3);
os << "[" << res.c << ", " << res.val << "] ";
return os;
}