-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpar.cpp
45 lines (35 loc) · 902 Bytes
/
par.cpp
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
#include "par.h"
template<class T, class U>
Par<T, U>::Par(T* first, U* second) {
firstElem = first;
secondElem = second;
}
template<typename T, typename U>
T* Par<T, U>::getFirst() {
return firstElem;
}
template<typename T, typename U>
U* Par<T, U>::getSecond() {
return secondElem;
}
template<class T, class U>
void Par<T, U>::setFirst(T* elem) {
firstElem = elem;
}
template<class T, class U>
void Par<T, U>::setSecond(U* elem) {
secondElem = elem;
}
template<typename T, typename U>
bool Par<T, U>::operator==(Par& second) {
return (firstElem == second.firstElem && secondElem == second.secondElem);
}
//template<typename T, typename U>
/*Par<T, U>::~Par() {
delete firstElem;
delete secondElem;
} */
template<typename T, typename U, class Par>
std::ostream& operator<<(std::ostream& it, Par& pair) {
it << '[' << pair.firstElem << '-' << pair.secondElem << ']' << std::endl;
}