-
Notifications
You must be signed in to change notification settings - Fork 1
/
Deleter.h
64 lines (52 loc) · 1.48 KB
/
Deleter.h
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
54
55
56
57
58
59
60
61
62
63
64
#ifndef _DELETER_H_
#define _DELETER_H_
#include <iostream>
using namespace std;
template<typename A>
void DeleteAll(A arr1)
{
delete [] arr1;
}
template<typename A, typename B>
void DeleteAll(A arr1, B arr2)
{
delete [] arr2;
DeleteAll(arr1);
}
template<typename A, typename B, typename C>
void DeleteAll(A arr1, B arr2, C arr3)
{
delete [] arr3;
DeleteAll(arr1, arr2);
}
template<typename A, typename B, typename C, typename D>
void DeleteAll(A arr1, B arr2, C arr3, D arr4)
{
delete [] arr4;
DeleteAll(arr1, arr2, arr3);
}
template<typename A, typename B, typename C, typename D, typename E>
void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5)
{
delete [] arr5;
DeleteAll(arr1, arr2, arr3, arr4);
}
template<typename A, typename B, typename C, typename D, typename E, typename F>
void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5, F arr6)
{
delete [] arr6;
DeleteAll(arr1, arr2, arr3, arr4,arr5);
}
template<typename A, typename B, typename C, typename D, typename E, typename F, typename G>
void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5, F arr6, G arr7)
{
delete [] arr7;
DeleteAll(arr1, arr2, arr3, arr4,arr5, arr6);
}
template<typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H>
void DeleteAll(A arr1, B arr2, C arr3, D arr4, E arr5, F arr6, G arr7, H arr8)
{
delete [] arr8;
DeleteAll(arr1, arr2, arr3, arr4,arr5,arr6,arr7);
}
#endif