2
2
<feed xmlns =" http://www.w3.org/2005/Atom" >
3
3
<title >cpprefjp - C++日本語リファレンス</title >
4
4
<link href =" https://cpprefjp.github.io" />
5
- <updated >2025-07-08T14:48:34.630717 </updated >
6
- <id >631751fe-95fe-4cd2-a7fc-e50abc59f218 </id >
5
+ <updated >2025-07-08T15:15:50.180086 </updated >
6
+ <id >5fec2cca-2f13-4007-b76d-7cb4e0413e9a </id >
7
7
8
8
9
+ <entry >
10
+ <title >realloc -- realloc : 備考を整理</title >
11
+ <link href =" https://cpprefjp.github.io/reference/cstdlib/realloc.html" />
12
+ <id >ec127b7079201b4ad45d6d985f3ae793870c301c:reference/cstdlib/realloc.md</id >
13
+ <updated >2025-07-09T00:11:33+09:00</updated >
14
+
15
+ <summary type =" html" >< pre>< code> diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md
16
+ index a42e20d5c..ac4df8fd2 100644
17
+ --- a/reference/cstdlib/realloc.md
18
+ +++ b/reference/cstdlib/realloc.md
19
+ @@ -27,16 +27,18 @@ namespace std {
20
+ - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。
21
+ - メモリが不足している場合、`nullptr`が返される。
22
+
23
+ -## 備考
24
+ -`new_size`が0の場合の動作は定義されていない。
25
+
26
+ ## 戻り値
27
+ 再確保できた場合、その領域の先頭のポインタを返す。
28
+
29
+ -なお、その領域はメモリリークを避けるため、`free`、`realloc`で解放する必要がある。
30
+ -
31
+ 失敗した場合、`nullptr`を返す。もとのポインタは有効なままで、解放する必要がある。
32
+
33
+ +
34
+ +## 備考
35
+ +- `new_size`が0の場合の動作は未規定。
36
+ +- 確保された領域はメモリリークを避けるため、`free`、`realloc`で解放する必要がある。
37
+ +
38
+ +
39
+ ## 例
40
+ ```cpp example
41
+ #include & lt;cstdlib& gt;
42
+ < /code>< /pre> </summary >
43
+
44
+ <author >
45
+ <name >Akira Takahashi</name >
46
+
47
+ </author >
48
+ </entry >
49
+
50
+ <entry >
51
+ <title >realloc -- realloc : インデントのエラーを修正</title >
52
+ <link href =" https://cpprefjp.github.io/reference/cstdlib/realloc.html" />
53
+ <id >7f399059bd0da68a435467af802301edc159f12e:reference/cstdlib/realloc.md</id >
54
+ <updated >2025-07-09T00:10:29+09:00</updated >
55
+
56
+ <summary type =" html" >< pre>< code> diff --git a/reference/cstdlib/realloc.md b/reference/cstdlib/realloc.md
57
+ index be2e9cf1a..a42e20d5c 100644
58
+ --- a/reference/cstdlib/realloc.md
59
+ +++ b/reference/cstdlib/realloc.md
60
+ @@ -21,15 +21,11 @@ namespace std {
61
+ ## 効果
62
+ メモリの確保は次のいずれかの方法で行われる。
63
+
64
+ - - 既存のメモリを拡張、縮小する。
65
+ -
66
+ - 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。
67
+ -
68
+ - 拡張した場合、新しい領域の内容は未規定。
69
+ -
70
+ - - 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。
71
+ -
72
+ - - メモリが不足している場合、`nullptr`が返される。
73
+ +- 既存のメモリを拡張、縮小する。
74
+ + - 縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。
75
+ + - 拡張した場合、新しい領域の内容は未規定。
76
+ +- 新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。
77
+ +- メモリが不足している場合、`nullptr`が返される。
78
+
79
+ ## 備考
80
+ `new_size`が0の場合の動作は定義されていない。
81
+ < /code>< /pre> </summary >
82
+
83
+ <author >
84
+ <name >Akira Takahashi</name >
85
+
86
+ </author >
87
+ </entry >
88
+
9
89
<entry >
10
90
<title >realloc -- realloc: 未定義 → 未規定</title >
11
91
<link href =" https://cpprefjp.github.io/reference/cstdlib/realloc.html" />
@@ -87,95 +167,4 @@ index 508213991..69648d655 100644
87
167
</author >
88
168
</entry >
89
169
90
- <entry >
91
- <title >erase -- deque::erase(): イテレータと参照の無効化について微修正</title >
92
- <link href =" https://cpprefjp.github.io/reference/deque/deque/erase.html" />
93
- <id >b7d05c0d904106c98c194f1a9cac27ad71253e8e:reference/deque/deque/erase.md</id >
94
- <updated >2025-07-08T22:49:10+09:00</updated >
95
-
96
- <summary type =" html" >< pre>< code> diff --git a/reference/deque/deque/erase.md b/reference/deque/deque/erase.md
97
- index 303d0facb..8d3174777 100644
98
- --- a/reference/deque/deque/erase.md
99
- +++ b/reference/deque/deque/erase.md
100
- @@ -20,7 +20,7 @@ iterator erase(const_iterator first, const_iterator last); // (2) C++11
101
- - (1) : `position`が指す要素を削除する。
102
- - (2) : イテレータ範囲`[first, last)`の要素を削除する。
103
-
104
- -もし削除がシーケンスの先頭または末尾から行われた場合、削除された要素へのイテレータと参照は無効化される。もし削除が中間位置から行われた場合、全てのイテレータと削除は無効化される。
105
- +もし削除がシーケンスの先頭または末尾から行われた場合、削除された要素へのイテレータと参照だけが無効化される(そのほかの要素への参照/イテレータは有効であり続ける)。一方、削除が中間位置から行われた場合は全てのイテレータと参照が無効化される。
106
-
107
-
108
- ## 戻り値
109
- < /code>< /pre> </summary >
110
-
111
- <author >
112
- <name >onihusube</name >
113
-
114
- </author >
115
- </entry >
116
-
117
- <entry >
118
- <title >derived_from -- improve std::derived_from</title >
119
- <link href =" https://cpprefjp.github.io/reference/concepts/derived_from.html" />
120
- <id >3f31163a0b1c6633b1c6940c4493066da0f339bc:reference/concepts/derived_from.md</id >
121
- <updated >2025-07-08T22:32:19+09:00</updated >
122
-
123
- <summary type =" html" >< pre>< code> diff --git a/reference/concepts/derived_from.md b/reference/concepts/derived_from.md
124
- index 869a70edd..2951ef9a9 100644
125
- --- a/reference/concepts/derived_from.md
126
- +++ b/reference/concepts/derived_from.md
127
- @@ -27,7 +27,7 @@ namespace std {
128
- - `Base`は`Derived`の曖昧ではない`public`継承されたクラスである
129
- - `Base`と`Derived`はCV修飾の違いを除いて同じクラス型である
130
-
131
- -`Derived`が`Base`を公開継承しない場合、[`std::is_base_of& lt;Derived, Base& gt;`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
132
- +`Derived`が`Base`を公開継承しない場合、[`std::is_base_of& lt;Base, Derived& gt;`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
133
-
134
- ## 例
135
- ```cpp example
136
- @@ -42,16 +42,16 @@ void check_derived() {
137
-
138
- template& lt;typename T, typename U& gt;
139
- void check_derived() {
140
- - std::cout & lt;& lt; & #34;U and T are others& #34; & lt;& lt; std::endl;
141
- + std::cout & lt;& lt; & #34;U is not base class of T& #34; & lt;& lt; std::endl;
142
- }
143
-
144
- struct Base {};
145
-
146
- //public継承
147
- struct Derived1 : Base {};
148
- -//private
149
- +//private継承
150
- struct Derived2 : private Base {};
151
- -//protected
152
- +//protected継承
153
- struct Derived3 : protected Base {};
154
- //曖昧な継承
155
- struct Derived4 : Base, Derived1 {};
156
- @@ -79,12 +79,12 @@ int main()
157
-
158
- ### 出力
159
- ```
160
- -U and T are others
161
- +U is not base class of T
162
- U is base class of T
163
- U is base class of T
164
- -U and T are others
165
- -U and T are others
166
- -U and T are others
167
- +U is not base class of T
168
- +U is not base class of T
169
- +U is not base class of T
170
- U is base class of T
171
- U is base class of T
172
- U is base class of T
173
- < /code>< /pre> </summary >
174
-
175
- <author >
176
- <name >suomesta</name >
177
-
178
- </author >
179
- </entry >
180
-
181
170
</feed >
0 commit comments