Yurttas/PL/OOL/Cplusplus/F/05/01/01/03/ta.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 <iostream>
18
19using namespace std;
20
21#include "T_A.h"
22
23template<class T0,
24 class T1>
25void ta() {
26 T_A<T0,T1> a;
27
28 cout << "a value after default construction-T_A<T0,T1>() /" << endl;
29 cout << a << endl;
30
31 a.set_a0(8);
32 a.set_a1(5);
33
34 cout << "a value after a.set_a0(8) /" << endl;
35 cout << " value after a.set_a0(5) /" << endl;
36 cout << a << endl;
37
38 T_A<T0,T1> b(2);
39
40 cout << "b value after default construction-T_A<T0,T1>(2) /" << endl;
41 cout << b << endl;
42
43 T_A<T0,T1> c(b);
44
45 cout << "c value after T_A<T0,T1> c(b) /" << endl;
46 cout << c << endl;
47
48 b = a;
49
50 cout << "b value after b=a /" << endl;
51 cout << b << endl;
52
53 cout << "b.get_a0() /" << endl;
54 cout << b.get_a0() << endl;
55 cout << "b.get_a1() /" << endl;
56 cout << b.get_a1() << endl;
57}