-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.cpp
More file actions
38 lines (33 loc) · 757 Bytes
/
operators.cpp
File metadata and controls
38 lines (33 loc) · 757 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
// ECE 4050 / CSC 5050 - Project 3
// Nathan Lucas
#include "operators.h"
// Insert `vec` into stream `os`
std::ostream& operator<<(std::ostream& os, const std::vector<int>& vec)
{
os << "vector : { ";
for (const auto element : vec)
{
os << element << " ";
}
return os << "}\n";
}
// Insert `list` into stream `os`
std::ostream& operator<<(std::ostream& os, const std::list<int>& list)
{
os << "list : { ";
for (const auto element : list)
{
os << element << " ";
}
return os << "}\n";
}
// Insert `set` into stream `os`
std::ostream& operator<<(std::ostream& os, const std::set<int>& set)
{
os << "set : { ";
for (const auto element : set)
{
os << element << " ";
}
return os << "}\n";
}