-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtut68.cpp
More file actions
53 lines (40 loc) · 716 Bytes
/
tut68.cpp
File metadata and controls
53 lines (40 loc) · 716 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <iostream>
using namespace std;
template <class t>
class yash
{
public:
t data;
yash(t a)
{
data = a;
}
void display();
};
template <class p>
void yash<p>::display()
{
cout << data << endl;
}
// void func(int a){
// cout<<"I am func() "<<a<<endl;
// }
template <class g>
void func(g a){
cout<<"I am templazied func() "<<a<<endl;
}
template <class e>
void func1(e a){
cout<<"I am templazied func1() "<<a<<endl;
}
int main()
{
// yash<int> op(6);
// yash<char> op('p');
// yash<float> op(6.5);
// cout << op.data << endl;
// op.display();
// func(5); // Exact mathc takes the highest priority.
func(4);
return 0;
}