Yurttas/PL/OOL/Cplusplus/F/05/01/01/02/T A.cpp
Jump to navigation
Jump to search
1/*
2 Copyright(C) 1998
3 All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4
5 Permission to use, copy, modify, and distribute this
6 software and its documentation for EDUCATIONAL purposes
7 and without fee is hereby granted provided that this
8 copyright notice appears in all copies.
9
10 date : September 1, 1998.
11 author : Salih Yurttas.
12
13 T_A.cpp
14*/
15
16
17#include "T_A.h"
18
19template<class T>
20T_A<T>::
21T_A(const T v) : a0(v),
22 a1(v) {
23}
24
25template<class T>
26T_A<T>::
27T_A(const T_A<T>& a) : a0(a.a0),
28 a1(a.a1) {
29}
30
31template<class T>
32T_A<T>&
33T_A<T>::
34operator=(const T_A<T>& a) {
35 a0 = a.a0;
36 a1 = a.a1;
37 return *this;
38}
39
40template<class T>
41T
42T_A<T>::
43get_a0() const {
44 return a0;
45}
46
47template<class T>
48T
49T_A<T>::
50get_a1() const {
51 return a1;
52}
53
54template<class T>
55void
56T_A<T>::
57set_a0(const T v) {
58 a0 = v;
59}
60
61template<class T>
62void
63T_A<T>::
64set_a1(const T v) {
65 a1 = v;
66}
67
68template<class T>
69ostream& operator<<(ostream& os,
70 const T_A<T>& a) {
71 os << a.a0 << endl;
72 os << a.a1 << endl;
73 os << endl;
74
75 return os;
76}