Yurttas/PL/OOL/Cplusplus/F/05/10/00/t.cpp

 1/*
 2   Copyright(C) 2007
 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   : December 1, 2007.
11   authorĀ : Salih Yurttas.
12
13   t.cpp
14*/
15
16
17#include "N.h"
18
19using namespace N;
20
21template<class T>
22void t() {
23
24  P<T>* p_a = new R<T>;
25
26  cout << *p_a << endl;
27
28  vector<T> v = p_a->get_a();
29
30/*
31  int n = v.size();
32  for(int i=0; i<n; ++i)
33    cout << v.at(i) << endl;
34  cout << endl;
35
36  n = 4;
37
38  for(int i=0; i<n; ++i)
39    v.push_back(i);
40
41  p_a->set_a(v);
42
43  v = p_a->get_a();
44
45  n = v.size();
46  for(int i=0; i<n; ++i)
47    cout << v.at(i) << endl;
48  cout << endl;
49
50  p_a->set_a(2,
51             6);
52
53  cout << *p_a << endl;
54
55  p_a = new Q<T>;
56
57  cout << *p_a << endl;
58
59  p_a->set_a(v);
60
61  p_a->set_a(1,
62             9);
63
64  cout << p_a << endl;
65
66  p_a = new P<T>;
67
68  cout << *p_a << endl;
69
70  P<T>* p_b = new Q<T>;
71
72  cout << *p_b << endl;
73
74  n = 2;
75
76  for(int i=0; i<n; ++i)
77    v.push_back(i);
78
79  p_a->set_a(v);
80
81  cout << *p_a << endl;
82
83  *p_a = *p_b;
84
85  cout << *p_a << endl;
86
87  Q<T>* q_a = new Q<T>;
88
89  cout << *q_a << endl;
90
91  cout << q_a->get_b() << endl;
92*/
93}