Skip to content

Commit 5c81ffd

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 47f523a commit 5c81ffd

File tree

4 files changed

+101
-109
lines changed

4 files changed

+101
-109
lines changed

reference/cmath/float_t.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
</head>
7070
<body>
71-
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;cmath&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;id-type&#34;: [&#34;type-alias&#34;], &#34;cpp&#34;: [&#34;cpp11&#34;]}, &#34;sources&#34;: [], &#34;page_id&#34;: [&#34;reference&#34;, &#34;cmath&#34;, &#34;float_t&#34;]}">
71+
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;cmath&#34;], &#34;namespace&#34;: [&#34;std&#34;], &#34;id-type&#34;: [&#34;type-alias&#34;], &#34;cpp&#34;: [&#34;cpp11&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;ae213c62400ac4d36d54f2397a2da0491b136068&#34;, &#34;source&#34;: &#34;#include &lt;cmath&gt;\n#include &lt;iostream&gt;\nint main() {\n std::float_t num = 1.010;\n std::cout &lt;&lt; num &lt;&lt; std::endl;\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;cmath&#34;, &#34;float_t&#34;]}">
7272
<nav class="navbar navbar-default" role="navigation">
7373
<div class="container-fluid">
7474
<div class="navbar-header">
@@ -188,12 +188,12 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2024-06-11T13:45:38">
192-
2024年06月11日 13時45分38秒
191+
<span itemprop="datePublished" content="2025-04-23T04:57:13">
192+
2025年04月23日 04時57分13秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196-
<span itemprop="name">Akira Takahashi</span>
196+
<span itemprop="name">rotarymars</span>
197197
</span>
198198
が更新
199199
</small></p>
@@ -221,6 +221,18 @@
221221
<h2>概要</h2>
222222
<p><code>float</code> と同じかそれより広い範囲の値を持つ浮動小数点数型を表す。</p>
223223
<p><code><a href="../cfloat/flt_eval_method.html">FLT_EVAL_METHOD</a></code> が 0 のとき <code>float</code>, 1 のとき <code>double</code>, 2 のとき <code>long double</code>, それ以外の場合は実装依存。</p>
224+
<h2></h2>
225+
<p><div class="yata" id="ae213c62400ac4d36d54f2397a2da0491b136068"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../cmath.html">&lt;cmath&gt;</a></span><span class="cp"></span>
226+
<span class="cp">#include</span> <span class="cpf"><a href="../iostream.html">&lt;iostream&gt;</a></span><span class="cp"></span>
227+
<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
228+
<span class="n">std</span><span class="o">::</span><span class="n">float_t</span> <span class="n">num</span> <span class="o">=</span> <span class="mf">1.010</span><span class="p">;</span>
229+
<span class="n"><a href="../iostream/cout.html">std::cout</a></span> <span class="o">&lt;&lt;</span> <span class="n">num</span> <span class="o">&lt;&lt;</span> <span class="n"><a href="../ostream/endl.html">std::endl</a></span><span class="p">;</span>
230+
<span class="p">}</span>
231+
</code></pre></div>
232+
</div></p>
233+
<h2>出力例</h2>
234+
<p><pre><code>1.01
235+
</code></pre></p>
224236
<h2>バージョン</h2>
225237
<h3>言語</h3>
226238
<ul>

reference/cstddef/null.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
</head>
7070
<body>
71-
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;cstddef&#34;], &#34;id-type&#34;: [&#34;macro&#34;]}, &#34;sources&#34;: [], &#34;page_id&#34;: [&#34;reference&#34;, &#34;cstddef&#34;, &#34;null&#34;]}">
71+
<header data-kunai-mdinfo="{&#34;meta&#34;: {&#34;header&#34;: [&#34;cstddef&#34;], &#34;id-type&#34;: [&#34;macro&#34;]}, &#34;sources&#34;: [{&#34;id&#34;: &#34;df5af68b0da823cdb67c83ee2b713c42aca82df3&#34;, &#34;source&#34;: &#34;#include &lt;cstddef&gt;\nint main() {\n int* p = NULL;\n delete p;\n}\n&#34;}], &#34;page_id&#34;: [&#34;reference&#34;, &#34;cstddef&#34;, &#34;null&#34;]}">
7272
<nav class="navbar navbar-default" role="navigation">
7373
<div class="container-fluid">
7474
<div class="navbar-header">
@@ -188,12 +188,12 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2023-01-07T04:33:17">
192-
2023年01月07日 04時33分17秒
191+
<span itemprop="datePublished" content="2025-04-23T05:00:47">
192+
2025年04月23日 05時00分47秒
193193
</span>
194194
<br/>
195195
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
196-
<span itemprop="name">Kazutoshi SATODA</span>
196+
<span itemprop="name">rotarymars</span>
197197
</span>
198198
が更新
199199
</small></p>
@@ -229,6 +229,14 @@ <h2>概要</h2>
229229
<li><code>&lt;ctime&gt;</code></li>
230230
<li><code>&lt;cwchar&gt;</code></li>
231231
</ul>
232+
<h2></h2>
233+
<p><div class="yata" id="df5af68b0da823cdb67c83ee2b713c42aca82df3"><div class="codehilite"><pre><span></span><code><span class="cp">#include</span> <span class="cpf"><a href="../cstddef.html">&lt;cstddef&gt;</a></span><span class="cp"></span>
234+
<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
235+
<span class="kt">int</span><span class="o">*</span> <span class="n">p</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
236+
<span class="k">delete</span> <span class="n">p</span><span class="p">;</span>
237+
<span class="p">}</span>
238+
</code></pre></div>
239+
</div></p>
232240
<h2>備考</h2>
233241
<p>C++03において、「ヌルポインタ定数」は「値が0になる整数定数式」と定義されていた。したがって、マクロ<code>NULL</code>の値として<code>0</code><code>0L</code>は規格に適合するが、<code>(void*)0</code>は整数定数式ではないため適合しない。</p>
234242
<p>C++11では、「ヌルポインタ定数」の定義に「<code><a href="nullptr_t.html">std::nullptr_t</a></code>型のprvalue」が追加されたため、<code>nullptr</code>も規格に適合する。しかし、<code>NULL</code>の値の型が変わるとコードの互換性を損なうことから、当面の間<code>NULL</code>の値は整数定数式であると思われる。C++11以降は<code>NULL</code>ではなく<code><a href="../../lang/cpp11/nullptr.html">nullptr</a></code>を使用するとよい。</p>

rss.xml

Lines changed: 71 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,69 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2025-04-23T04:54:03.242294</updated>
6-
<id>63106600-bbb1-4e8a-a8dd-a740e75af083</id>
5+
<updated>2025-04-23T05:04:45.036935</updated>
6+
<id>95c5f72b-37a4-43d0-a18d-aae846d8887c</id>
77

88

99
<entry>
10-
<title>double_t -- reference/cmath/double_t.md: New sample program</title>
11-
<link href="https://cpprefjp.github.io/reference/cmath/double_t.html"/>
12-
<id>dbd3566a381d0bbccd28bfa51211ebeee04a4c5e:reference/cmath/double_t.md</id>
13-
<updated>2025-04-23T13:49:45+09:00</updated>
10+
<title>NULL -- reference/cstddef/null.md: Created sample program</title>
11+
<link href="https://cpprefjp.github.io/reference/cstddef/null.html"/>
12+
<id>06d798bc7c7a4d09d7a907cf3d53d3f63bbd2bf6:reference/cstddef/null.md</id>
13+
<updated>2025-04-23T14:00:47+09:00</updated>
1414

15-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md
16-
index 5fecdefac..57ea716c5 100644
17-
--- a/reference/cmath/double_t.md
18-
+++ b/reference/cmath/double_t.md
19-
@@ -15,6 +15,20 @@ namespace std {
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/cstddef/null.md b/reference/cstddef/null.md
16+
index 4626fc22b..d7dc7f55f 100644
17+
--- a/reference/cstddef/null.md
18+
+++ b/reference/cstddef/null.md
19+
@@ -20,6 +20,14 @@
20+
- `&amp;lt;ctime&amp;gt;`
21+
- `&amp;lt;cwchar&amp;gt;`
2022

21-
[`FLT_EVAL_METHOD`](/reference/cfloat/flt_eval_method.md) が 0 または 1 のとき `double`, 2 のとき `long double`, それ以外の場合は実装依存。
23+
+## 例
24+
+```cpp example
25+
+#include &amp;lt;cstddef&amp;gt;
26+
+int main() {
27+
+ int* p = NULL;
28+
+ delete p;
29+
+}
30+
+```
2231

23-
+## 使用例
32+
## 備考
33+
C++03において、「ヌルポインタ定数」は「値が0になる整数定数式」と定義されていた。したがって、マクロ`NULL`の値として`0`や`0L`は規格に適合するが、`(void*)0`は整数定数式ではないため適合しない。
34+
&lt;/code&gt;&lt;/pre&gt;</summary>
35+
36+
<author>
37+
<name>rotarymars</name>
38+
<email>s.goto2050@gmail.com</email>
39+
</author>
40+
</entry>
41+
42+
<entry>
43+
<title>float_t -- reference/cmath/float_t.md: Created sample program</title>
44+
<link href="https://cpprefjp.github.io/reference/cmath/float_t.html"/>
45+
<id>75705c0f0d110870eb19be7d80a1b0921910a1ef:reference/cmath/float_t.md</id>
46+
<updated>2025-04-23T13:57:13+09:00</updated>
47+
48+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/cmath/float_t.md b/reference/cmath/float_t.md
49+
index 9eb93ac0b..d05aa527b 100644
50+
--- a/reference/cmath/float_t.md
51+
+++ b/reference/cmath/float_t.md
52+
@@ -15,6 +15,19 @@ namespace std {
53+
54+
[`FLT_EVAL_METHOD`](/reference/cfloat/flt_eval_method.md) が 0 のとき `float`, 1 のとき `double`, 2 のとき `long double`, それ以外の場合は実装依存。
55+
56+
+## 例
2457
+```cpp example
2558
+#include &amp;lt;cmath&amp;gt;
2659
+#include &amp;lt;iostream&amp;gt;
2760
+int main() {
28-
+ std::double_t num = 1.00001;
61+
+ std::float_t num = 1.010;
2962
+ std::cout &amp;lt;&amp;lt; num &amp;lt;&amp;lt; std::endl;
3063
+}
3164
+```
32-
+
3365
+## 出力例
3466
+```
35-
+1.00001
67+
+1.01
3668
+```
3769

3870
## バージョン
@@ -46,96 +78,36 @@ index 5fecdefac..57ea716c5 100644
4678
</entry>
4779

4880
<entry>
49-
<title>契約プログラミング [P2900R14] -- lang/cpp26/contracts.md: Fixed it correctly</title>
50-
<link href="https://cpprefjp.github.io/lang/cpp26/contracts.html"/>
51-
<id>93cfae5853d0ecb315d930cbecf7845d162b5a3a:lang/cpp26/contracts.md</id>
52-
<updated>2025-04-23T12:06:32+09:00</updated>
81+
<title>double_t -- reference/cmath/double_t.md: New sample program</title>
82+
<link href="https://cpprefjp.github.io/reference/cmath/double_t.html"/>
83+
<id>dbd3566a381d0bbccd28bfa51211ebeee04a4c5e:reference/cmath/double_t.md</id>
84+
<updated>2025-04-23T13:49:45+09:00</updated>
5385

54-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/lang/cpp26/contracts.md b/lang/cpp26/contracts.md
55-
index f8af8f946..0d82b64e6 100644
56-
--- a/lang/cpp26/contracts.md
57-
+++ b/lang/cpp26/contracts.md
58-
@@ -17,6 +17,20 @@ C++26では、関数の正確な動作を明示的に指定でき、プログラ
59-
この機能は、関数のインターフェースに対する期待値を明確にする役割があり、バグの早期発見、コードの可読性向上に寄与することが期待されている。
60-
61-
## 仕様
62-
+### キーワード
63-
+`pre`、`post`、`assert`は文脈依存キーワードである。これらは`override`や`final`と同様に、特定の文脈でのみ特別な意味を持つ。
64-
+
65-
+- 変数名や関数名として使用可能
66-
+ ```cpp
67-
+ int pre = 42; // OK: 変数名として使用
68-
+ void post() {} // OK: 関数名として使用
69-
+ ```
70-
+- 契約指定の文脈でのみ特別な意味を持つ
71-
+ ```cpp
72-
+ void f()
73-
+ pre(true); // ここでは契約指定として機能
74-
+ ```
75-
+
76-
### 契約の種類
77-
契約には以下の3種類が定められている。
86+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/cmath/double_t.md b/reference/cmath/double_t.md
87+
index 5fecdefac..57ea716c5 100644
88+
--- a/reference/cmath/double_t.md
89+
+++ b/reference/cmath/double_t.md
90+
@@ -15,6 +15,20 @@ namespace std {
7891

79-
@@ -35,6 +49,24 @@ int safe_division(int numerator, int denominator)
80-
```
81-
ここでは、`denominator`が0でないことを事前条件として指定している。
92+
[`FLT_EVAL_METHOD`](/reference/cfloat/flt_eval_method.md) が 0 または 1 のとき `double`, 2 のとき `long double`, それ以外の場合は実装依存。
8293

83-
+事前条件では、必ずしも関数のパラメータを使用する必要はない。グローバル状態やクラスのメンバ変数など、呼び出し時点で有効な任意の式を使用できる。
84-
+```cpp
85-
+class Resource {
86-
+private:
87-
+ bool is_available = false;
88-
+public:
89-
+ void use()
90-
+ pre(is_available) // 引数を使用していない事前条件
91-
+ {
92-
+ // リソースを使用
93-
+ }
94-
+
95-
+ void activate() {
96-
+ is_available = true;
97-
+ }
98-
+};
94+
+## 使用例
95+
+```cpp example
96+
+#include &amp;lt;cmath&amp;gt;
97+
+#include &amp;lt;iostream&amp;gt;
98+
+int main() {
99+
+ std::double_t num = 1.00001;
100+
+ std::cout &amp;lt;&amp;lt; num &amp;lt;&amp;lt; std::endl;
101+
+}
99102
+```
100103
+
101-
#### 事後条件(post)
102-
関数の実行後に満たされているべき条件を指定する。
103-
```cpp
104-
@@ -48,6 +80,25 @@ int increment(int x)
105-
106-
`post`では、返り値を`r`としてバインドし、条件式内で利用している。ここには、任意の変数名が使用できる。変数は定数(`const`)な左辺値参照である。
107-
108-
+事後条件の結果名導入子(result-name-introducer)は省略可能である。特に、`void`を返す関数では、戻り値を参照する必要がない場合に省略できる。
109-
+
110-
+```cpp
111-
+class Container {
112-
+ // ...
113-
+public:
114-
+ void clear()
115-
+ post(empty()) // 結果名導入子を省略した事後条件
116-
+ {
117-
+ // コンテナの内容をクリア
118-
+ }
119-
+
120-
+ bool empty() const {
121-
+ // コンテナが空かどうかを返す
122-
+ return true;
123-
+ }
124-
+};
104+
+## 出力例
105+
+```
106+
+1.00001
125107
+```
126-
+
127-
#### アサーション(assert)
128-
関数の実行中に満たされているべき条件を指定する。
129-
```cpp
130-
@@ -101,7 +152,7 @@ g++ -std=c++26 -fcontracts -fcontract-semantic=observe main.cpp
131-
以下の操作は、気をつけなければならない。
132-
- 契約式内において副作用を要する式を記述した場合(グローバル変数の変更、`volatile`変数への参照、`constexpr`でない関数の呼び出しなど)
133-
- 契約式内で例外を送出すると、std::terminate()が呼び出され、プログラムが終了する。
134-
-- 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不正(ill-formed)となる。
135-
+- 通常の関数やメンバ関数には契約を適用できるが、特殊な関数(例えば`default`によって定義されたコピーコンストラクタやデストラクタ)には適用できない。適用すると、プログラムは不適格(ill-formed)となる。
136108

137-
## &amp;lt;a id=&amp;#34;relative-page&amp;#34; href=&amp;#34;#relative-page&amp;#34;&amp;gt;関連項目&amp;lt;/a&amp;gt;
138-
- [C++ 将来 契約に基づくプログラミング](/lang/future/contract-based_programming.md)
109+
## バージョン
110+
### 言語
139111
&lt;/code&gt;&lt;/pre&gt;</summary>
140112

141113
<author>

sitemap.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12883,7 +12883,7 @@
1288312883

1288412884
<url>
1288512885
<loc>https://cpprefjp.github.io/reference/cmath/float_t.html</loc>
12886-
<lastmod>2025-04-03T12:32:11+09:00</lastmod>
12886+
<lastmod>2025-04-23T13:57:13+09:00</lastmod>
1288712887
<changefreq>daily</changefreq>
1288812888
<priority>0.7</priority>
1288912889
</url>
@@ -23768,7 +23768,7 @@
2376823768

2376923769
<url>
2377023770
<loc>https://cpprefjp.github.io/reference/cstddef/null.html</loc>
23771-
<lastmod>2025-04-03T12:32:11+09:00</lastmod>
23771+
<lastmod>2025-04-23T14:00:47+09:00</lastmod>
2377223772
<changefreq>daily</changefreq>
2377323773
<priority>0.7</priority>
2377423774
</url>

0 commit comments

Comments
 (0)