Skip to content

Commit 52622bd

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 8160053 commit 52622bd

File tree

3 files changed

+96
-109
lines changed

3 files changed

+96
-109
lines changed

reference/cstdlib/realloc.html

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2025-07-08T14:28:00">
192-
2025年07月08日 14時28分00秒
191+
<span itemprop="datePublished" content="2025-07-08T15:11:33">
192+
2025年07月08日 15時11分33秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -226,24 +226,22 @@ <h2>概要</h2>
226226
<h2>効果</h2>
227227
<p>メモリの確保は次のいずれかの方法で行われる。</p>
228228
<ul>
229-
<li>
230-
<p>既存のメモリを拡張、縮小する。</p>
231-
<p>縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。</p>
232-
<p>拡張した場合、新しい領域の内容は<a class="cpprefjp-defined-word" data-desc="未規定の動作。事前の断りなく処理系によって異なる動作をする" href="../../implementation-compliance.html#dfn-unspecified-behavior">未規定</a></p>
233-
</li>
234-
<li>
235-
<p>新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。</p>
236-
</li>
237-
<li>
238-
<p>メモリが不足している場合、<code>nullptr</code>が返される。</p>
229+
<li>既存のメモリを拡張、縮小する。<ul>
230+
<li>縮小した場合、再確保されたメモリのサイズまでの領域の内容が保持される。</li>
231+
<li>拡張した場合、新しい領域の内容は<a class="cpprefjp-defined-word" data-desc="未規定の動作。事前の断りなく処理系によって異なる動作をする" href="../../implementation-compliance.html#dfn-unspecified-behavior">未規定</a></li>
232+
</ul>
239233
</li>
234+
<li>新しいサイズの領域を確保、割り当てする。その後、新しいサイズと古いサイズのいずれか小さい方のサイズに等しいメモリ領域をコピーし、古いブロックを解放する。</li>
235+
<li>メモリが不足している場合、<code>nullptr</code>が返される。</li>
240236
</ul>
241-
<h2>備考</h2>
242-
<p><code>new_size</code>が0の場合の動作は定義されていない。</p>
243237
<h2><a class="cpprefjp-defined-word" data-desc="関数呼び出し式の評価結果となるオブジェクト・値">戻り値</a></h2>
244238
<p>再確保できた場合、その領域の先頭のポインタを返す。</p>
245-
<p>なお、その領域はメモリリークを避けるため、<code>free</code><code>realloc</code>で解放する必要がある。</p>
246239
<p>失敗した場合、<code>nullptr</code>を返す。もとのポインタは有効なままで、解放する必要がある。</p>
240+
<h2>備考</h2>
241+
<ul>
242+
<li><code>new_size</code>が0の場合の動作は<a class="cpprefjp-defined-word" data-desc="未規定の動作。事前の断りなく処理系によって異なる動作をする" href="../../implementation-compliance.html#dfn-unspecified-behavior">未規定</a></li>
243+
<li>確保された領域はメモリリークを避けるため、<code>free</code><code>realloc</code>で解放する必要がある。</li>
244+
</ul>
247245
<h2></h2>
248246
<p><div class="yata" id="3a5ead90b59d39a8b4c36a28b82eef1c3532e5a7"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../cstdlib.html">&lt;cstdlib&gt;</a></span><span class="cp"></span>
249247
<span class="cp">#include</span> <span class="cpf"><a href="../iostream.html">&lt;iostream&gt;</a></span><span class="cp"></span>

rss.xml

Lines changed: 82 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,90 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<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>
77

88

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">&lt;pre&gt;&lt;code&gt;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 &amp;lt;cstdlib&amp;gt;
42+
&lt;/code&gt;&lt;/pre&gt;</summary>
43+
44+
<author>
45+
<name>Akira Takahashi</name>
46+
<email>[email protected]</email>
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">&lt;pre&gt;&lt;code&gt;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+
&lt;/code&gt;&lt;/pre&gt;</summary>
82+
83+
<author>
84+
<name>Akira Takahashi</name>
85+
<email>[email protected]</email>
86+
</author>
87+
</entry>
88+
989
<entry>
1090
<title>realloc -- realloc: 未定義 → 未規定</title>
1191
<link href="https://cpprefjp.github.io/reference/cstdlib/realloc.html"/>
@@ -87,95 +167,4 @@ index 508213991..69648d655 100644
87167
</author>
88168
</entry>
89169

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">&lt;pre&gt;&lt;code&gt;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-
&lt;/code&gt;&lt;/pre&gt;</summary>
110-
111-
<author>
112-
<name>onihusube</name>
113-
<email>[email protected]</email>
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">&lt;pre&gt;&lt;code&gt;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&amp;lt;Derived, Base&amp;gt;`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
132-
+`Derived`が`Base`を公開継承しない場合、[`std::is_base_of&amp;lt;Base, Derived&amp;gt;`](/reference/type_traits/is_base_of.md)の判定とは異なる結果となる。
133-
134-
## 例
135-
```cpp example
136-
@@ -42,16 +42,16 @@ void check_derived() {
137-
138-
template&amp;lt;typename T, typename U&amp;gt;
139-
void check_derived() {
140-
- std::cout &amp;lt;&amp;lt; &amp;#34;U and T are others&amp;#34; &amp;lt;&amp;lt; std::endl;
141-
+ std::cout &amp;lt;&amp;lt; &amp;#34;U is not base class of T&amp;#34; &amp;lt;&amp;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-
&lt;/code&gt;&lt;/pre&gt;</summary>
174-
175-
<author>
176-
<name>suomesta</name>
177-
<email>[email protected]</email>
178-
</author>
179-
</entry>
180-
181170
</feed>

sitemap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31454,7 +31454,7 @@
3145431454

3145531455
<url>
3145631456
<loc>https://cpprefjp.github.io/reference/cstdlib/realloc.html</loc>
31457-
<lastmod>2025-07-08T23:28:00+09:00</lastmod>
31457+
<lastmod>2025-07-09T00:11:33+09:00</lastmod>
3145831458
<changefreq>daily</changefreq>
3145931459
<priority>0.7</priority>
3146031460
</url>

0 commit comments

Comments
 (0)