回答編集履歴

1

追記

2020/02/22 04:39

投稿

asm
asm

スコア15147

test CHANGED
@@ -1,4 +1,6 @@
1
- C++17がないとちょっと[扱いづらく](https://cpprefjp.github.io/reference/memory/shared_ptr/op_at.html)なりますが
1
+ ~~C++17がないとちょっと[扱いづらく](https://cpprefjp.github.io/reference/memory/shared_ptr/op_at.html)なりますが~~
2
+
3
+ C++17でないと`std::shared_ptr<char[]> buffer;`は使えないようでした。
2
4
 
3
5
 
4
6
 
@@ -19,3 +21,31 @@
19
21
  }
20
22
 
21
23
  ```
24
+
25
+
26
+
27
+ ----
28
+
29
+
30
+
31
+ C++14以前ですと
32
+
33
+
34
+
35
+
36
+
37
+ ```c++
38
+
39
+ std::shared_ptr<char> buf;
40
+
41
+ void Create(int x, int y){
42
+
43
+ buf.reset(new char[x*y], std::default_delete<char[]>());
44
+
45
+ }
46
+
47
+ ```
48
+
49
+
50
+
51
+ になります。