回答編集履歴
1
修正
test
CHANGED
@@ -52,8 +52,38 @@
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
+
template<class type>
|
56
|
+
|
57
|
+
sample<type>::sample(type a) { printf("sample<type>\n"); }
|
58
|
+
|
59
|
+
template<class type>
|
60
|
+
|
61
|
+
void sample<type>::f() { printf("sample<type>::f\n"); }
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
55
|
-
sample<std::vector<int>>::sample(std::vector<int> a):test() { printf("sample"); }
|
67
|
+
sample<std::vector<int>>::sample(std::vector<int> a):test() { printf("sample<std::vector<int>>\n"); }
|
56
68
|
|
57
69
|
void sample<std::vector<int>>::f() { printf("えええ\n"); }
|
58
70
|
|
71
|
+
|
72
|
+
|
73
|
+
int main() {
|
74
|
+
|
75
|
+
sample<int> sample_int(123);
|
76
|
+
|
77
|
+
sample_int.f();
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
std::vector<int> v;
|
82
|
+
|
83
|
+
sample<std::vector<int>> sample_vector(v);
|
84
|
+
|
85
|
+
sample_vector.f();
|
86
|
+
|
87
|
+
}
|
88
|
+
|
59
89
|
```
|