回答編集履歴
2
fix: C++17ではtypename必要
answer
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
template<class Vec>
|
10
10
|
void func(Vec&& vec){
|
11
|
-
using Type = std::remove_cv_t<std::remove_reference_t<Vec>>::value_type;
|
11
|
+
using Type = typename std::remove_cv_t<std::remove_reference_t<Vec>>::value_type;
|
12
12
|
// using Type = std::remove_cvref_t<Vec>::value_type; // C++20以降
|
13
13
|
Type var = 0;
|
14
14
|
|
1
add external link
answer
CHANGED
@@ -14,4 +14,6 @@
|
|
14
14
|
|
15
15
|
//...
|
16
16
|
}
|
17
|
-
```
|
17
|
+
```
|
18
|
+
|
19
|
+
[https://qiita.com/7of9/items/6a3314af4a4369d85631](https://qiita.com/7of9/items/6a3314af4a4369d85631) にあるコメントも参考にどうぞ。
|