Skip to content

Commit 6c5f029

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 57116aa commit 6c5f029

File tree

3 files changed

+51
-69
lines changed

3 files changed

+51
-69
lines changed

lang/cpp17/constexpr_lambda.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@
188188

189189
<p class="text-right"><small>
190190
最終更新日時(UTC):
191-
<span itemprop="datePublished" content="2024-07-08T07:33:21">
192-
2024年07月08日 07時33分21秒
191+
<span itemprop="datePublished" content="2025-04-20T05:50:30">
192+
2025年04月20日 05時50分30秒
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">tshino</span>
197197
</span>
198198
が更新
199199
</small></p>
@@ -221,7 +221,7 @@ <h2>概要</h2>
221221
<p>C++17から、ラムダ式をconstexpr関数として使えるようになった。</p>
222222
<p>また、制限を満たすラムダ式が生成するクロージャオブジェクトがリテラルとして扱われるようになった。</p>
223223
<h2>仕様</h2>
224-
<p>ラムダ式のキャプチャが全てコンパイル時定数とき、そのラムダ式をconstexprの文脈で使うことができる。</p>
224+
<p>ラムダ式のキャプチャが全てコンパイル時定数のとき、そのラムダ式をconstexprの文脈で使うことができる。</p>
225225
<p><div class="yata" id="dcceb5149e600e6968f8c59de5e49cb06a4dc79d"><div class="codehilite"><pre><span></span><code><span class="k">constexpr</span> <span class="kt">int</span> <span class="nf">add_one</span><span class="p">(</span><span class="kt">int</span> <span class="n">n</span><span class="p">){</span>
226226
<span class="c1">// nがコンパイル時定数ならラムダ式をconstexprの文脈で使える</span>
227227
<span class="k">return</span> <span class="p">[</span><span class="n">n</span><span class="p">]{</span> <span class="k">return</span> <span class="n">n</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">}();</span>
@@ -261,7 +261,7 @@ <h2>仕様</h2>
261261
</code></pre></div>
262262
</div></p>
263263
<p>constexpr修飾されていないラムダ式のoperator()はラムダ式がconstexpr関数としての条件を満たす場合</p>
264-
<p>つまりラムダ式のキャプチャが全てコンパイル時定数とき</p>
264+
<p>つまりラムダ式のキャプチャが全てコンパイル時定数のとき</p>
265265
<p>自動的にconstexpr指定される。</p>
266266
<p><div class="yata" id="213a61b452f0ecf941c9f45caffcc05cd335561f"><div class="codehilite"><pre><span></span><code><span class="kt">int</span> <span class="nf">main</span><span class="p">(){</span>
267267
<span class="k">auto</span> <span class="n">twice</span> <span class="o">=</span> <span class="p">[](</span><span class="kt">int</span> <span class="n">n</span><span class="p">){</span> <span class="k">return</span> <span class="n">n</span><span class="o">*</span><span class="mi">2</span><span class="p">;</span> <span class="p">};</span>

rss.xml

Lines changed: 45 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,53 @@
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-19T14:41:36.515724</updated>
6-
<id>956f7d72-f99b-42a9-b665-a3a1061f047a</id>
5+
<updated>2025-04-20T05:53:54.449233</updated>
6+
<id>972e2dee-741d-4631-aa5e-10f3aefb81e9</id>
77

88

9+
<entry>
10+
<title>constexpr ラムダ [P0170R1] -- 「定数とき」→「定数のとき」</title>
11+
<link href="https://cpprefjp.github.io/lang/cpp17/constexpr_lambda.html"/>
12+
<id>9bd96532716d3a0abf4b3f8793229ac61a4c082e:lang/cpp17/constexpr_lambda.md</id>
13+
<updated>2025-04-20T14:50:30+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/lang/cpp17/constexpr_lambda.md b/lang/cpp17/constexpr_lambda.md
16+
index 5a118885d..e4d3a09e3 100644
17+
--- a/lang/cpp17/constexpr_lambda.md
18+
+++ b/lang/cpp17/constexpr_lambda.md
19+
@@ -18,7 +18,7 @@ C++17から、ラムダ式をconstexpr関数として使えるようになった
20+
21+
## 仕様
22+
23+
-ラムダ式のキャプチャが全てコンパイル時定数とき、そのラムダ式をconstexprの文脈で使うことができる。
24+
+ラムダ式のキャプチャが全てコンパイル時定数のとき、そのラムダ式をconstexprの文脈で使うことができる。
25+
26+
```cpp example
27+
constexpr int add_one(int n){
28+
@@ -68,7 +68,7 @@ int main(){
29+
30+
constexpr修飾されていないラムダ式のoperator()はラムダ式がconstexpr関数としての条件を満たす場合
31+
32+
-(つまりラムダ式のキャプチャが全てコンパイル時定数とき)
33+
+(つまりラムダ式のキャプチャが全てコンパイル時定数のとき)
34+
35+
自動的にconstexpr指定される。
36+
37+
@@ -201,4 +201,4 @@ C++14まではラムダ式がコンパイル時に呼び出せないため、
38+
## 参照
39+
40+
(執筆中)
41+
-- [P0170R1 Wording for Constexpr Lambda](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf)
42+
\ No newline at end of file
43+
+- [P0170R1 Wording for Constexpr Lambda](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0170r1.pdf)
44+
&lt;/code&gt;&lt;/pre&gt;</summary>
45+
46+
<author>
47+
<name>tshino</name>
48+
<email>tshino@users.noreply.github.com</email>
49+
</author>
50+
</entry>
51+
952
<entry>
1053
<title>execution -- execution: schedule_result_t (#1384)</title>
1154
<link href="https://cpprefjp.github.io/reference/execution/execution.html"/>
@@ -543,65 +586,4 @@ index 9c6e4c668..90fc7ed10 100644
543586
</author>
544587
</entry>
545588

546-
<entry>
547-
<title>splice_after -- Merge pull request #1439 from Gumichocopengin8/fix/unnecessary-move-in-forwared_list-splice</title>
548-
<link href="https://cpprefjp.github.io/reference/forward_list/forward_list/splice_after.html"/>
549-
<id>cf9270b138e48e98ba492cd99978e911d6d096be:reference/forward_list/forward_list/splice_after.md</id>
550-
<updated>2025-04-19T10:57:28+09:00</updated>
551-
552-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/forward_list/forward_list/splice_after.md b/reference/forward_list/forward_list/splice_after.md
553-
index d5404cf6e..ecb33dfab 100644
554-
--- a/reference/forward_list/forward_list/splice_after.md
555-
+++ b/reference/forward_list/forward_list/splice_after.md
556-
@@ -67,7 +67,6 @@ void splice_after(const_iterator position, forward_list&amp;amp;&amp;amp; x,
557-
```cpp example
558-
#include &amp;lt;iostream&amp;gt;
559-
#include &amp;lt;forward_list&amp;gt;
560-
-#include &amp;lt;utility&amp;gt;
561-
#include &amp;lt;iterator&amp;gt;
562-
563-
template &amp;lt;class T&amp;gt;
564-
@@ -84,7 +83,7 @@ int main()
565-
std::forward_list&amp;lt;int&amp;gt; xs = {1, 5, 6};
566-
std::forward_list&amp;lt;int&amp;gt; ys = {2, 3, 4};
567-
568-
- xs.splice_after(xs.begin(), std::move(ys));
569-
+ xs.splice_after(xs.begin(), ys);
570-
571-
print(xs);
572-
}
573-
@@ -93,7 +92,7 @@ int main()
574-
std::forward_list&amp;lt;int&amp;gt; xs = {1, 5, 6};
575-
std::forward_list&amp;lt;int&amp;gt; ys = {2, 3, 4};
576-
577-
- xs.splice_after(xs.begin(), std::move(ys), ys.begin());
578-
+ xs.splice_after(xs.begin(), ys, ys.begin());
579-
580-
print(xs);
581-
}
582-
@@ -102,7 +101,7 @@ int main()
583-
std::forward_list&amp;lt;int&amp;gt; xs = {1, 5, 6};
584-
std::forward_list&amp;lt;int&amp;gt; ys = {2, 3, 4};
585-
586-
- xs.splice_after(xs.begin(), std::move(ys), ys.before_begin(), std::next(ys.begin(), 2));
587-
+ xs.splice_after(xs.begin(), ys, ys.before_begin(), std::next(ys.begin(), 2));
588-
589-
print(xs);
590-
}
591-
@@ -110,7 +109,6 @@ int main()
592-
```
593-
* splice_after[color ff0000]
594-
* begin()[link begin.md]
595-
-* std::move[link /reference/utility/move.md]
596-
* std::next[link /reference/iterator/next.md]
597-
598-
### 出力
599-
&lt;/code&gt;&lt;/pre&gt;</summary>
600-
601-
<author>
602-
<name>Akira Takahashi</name>
603-
<email>faithandbrave@gmail.com</email>
604-
</author>
605-
</entry>
606-
607589
</feed>

sitemap.xml

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

3803538035
<url>
3803638036
<loc>https://cpprefjp.github.io/lang/cpp17/constexpr_lambda.html</loc>
38037-
<lastmod>2025-04-03T12:32:11+09:00</lastmod>
38037+
<lastmod>2025-04-20T14:50:30+09:00</lastmod>
3803838038
<changefreq>daily</changefreq>
3803938039
<priority>0.7</priority>
3804038040
</url>

0 commit comments

Comments
 (0)