Skip to content

Commit 6db74f0

Browse files
author
cpprefjp-autoupdate
committed
update automatically
1 parent 8286519 commit 6db74f0

File tree

3 files changed

+56
-168
lines changed

3 files changed

+56
-168
lines changed

reference/map/map/try_emplace.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@
200200

201201
<p class="text-right"><small>
202202
最終更新日時(UTC):
203-
<span itemprop="datePublished" content="2025-05-15T06:51:25">
204-
2025年05月15日 06時51分25秒
203+
<span itemprop="datePublished" content="2025-05-18T05:59:17">
204+
2025年05月18日 05時59分17秒
205205
</span>
206206
<br/>
207207
<span itemprop="author" itemscope itemtype="http://schema.org/Person">
@@ -271,15 +271,20 @@ <h2>概要</h2>
271271
</ul>
272272
<h2><a class="cpprefjp-defined-word" data-desc="関数等の意味論を構成する要素の1つ。Constraints。関数であればオーバーロード解決に参加するための条件、それ以外であれば受け付ける型の条件">テンプレートパラメータ制約</a></h2>
273273
<ul>
274-
<li>(1)、(3)、(5) : <code>value_type</code> は、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(k)</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から <code>map</code> に直接構築可能であること</li>
275-
<li>(2)、(4)、(6) : <code>value_type</code> は、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/move.html">move</a>(k))</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から <code>map</code> に直接構築可能であること</li>
274+
<li>(1)、(3)、(5)、(6) : <code>value_type</code> は、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(k)</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から <code>map</code> に直接構築可能であること</li>
275+
<li>(2)、(4) : <code>value_type</code> は、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/move.html">move</a>(k))</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から <code>map</code> に直接構築可能であること</li>
276276
<li>(5), (6) : <code>key_compare::is_transparent</code> が妥当な式であること</li>
277+
<li>(5) : 以下のすべてを満たすこと:<ul>
278+
<li><code><a href="../../type_traits/is_convertible.html">is_convertible_v</a>&lt;K&amp;&amp;, const_iterator&gt; == false</code></li>
279+
<li><code><a href="../../type_traits/is_convertible.html">is_convertible_v</a>&lt;K&amp;&amp;, iterator&gt; == false</code></li>
280+
</ul>
281+
</li>
277282
</ul>
278283
<p>なお、規格に記載はないが、<code>hint</code><code><a href="emplace_hint.html">emplace_hint</a></code> と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。</p>
279284
<h2>効果</h2>
280285
<ul>
281-
<li>(1)、(3)、(5) : <code>map</code><code>k</code> と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(k)</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から構築した <code>value_type</code> 型のオブジェクトを挿入する。</li>
282-
<li>(2)、(4)、(6) : <code>map</code><code>k</code> と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/move.html">move</a>(k))</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から構築した <code>value_type</code> 型のオブジェクトを挿入する。</li>
286+
<li>(1)、(3)、(5)、(6) : <code>map</code><code>k</code> と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(k)</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から構築した <code>value_type</code> 型のオブジェクトを挿入する。</li>
287+
<li>(2)、(4) : <code>map</code><code>k</code> と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、<code><a href="../../utility/piecewise_construct_t.html">piecewise_construct</a></code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/move.html">move</a>(k))</code>, <code><a href="../../tuple/forward_as_tuple.html">forward_as_tuple</a>(<a href="../../utility/forward.html">forward</a>&lt;Args&gt;(args)...)</code> から構築した <code>value_type</code> 型のオブジェクトを挿入する。</li>
283288
</ul>
284289
<h2><a class="cpprefjp-defined-word" data-desc="関数呼び出し式の評価結果となるオブジェクト・値">戻り値</a></h2>
285290
<ul>

rss.xml

Lines changed: 44 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,52 @@
22
<feed xmlns="http://www.w3.org/2005/Atom">
33
<title>cpprefjp - C++日本語リファレンス</title>
44
<link href="https://cpprefjp.github.io" />
5-
<updated>2025-05-17T14:42:24.135672</updated>
6-
<id>95efea7e-a584-4981-8393-9321de84d8d6</id>
5+
<updated>2025-05-18T06:02:49.199310</updated>
6+
<id>407a11f7-4695-4fa2-9602-216660dd87c2</id>
77

88

9+
<entry>
10+
<title>try_emplace -- map::try_emplace : 要件を修正 #1189</title>
11+
<link href="https://cpprefjp.github.io/reference/map/map/try_emplace.html"/>
12+
<id>3175722cafabd80cce386bdfb2de0656b1ac46b8:reference/map/map/try_emplace.md</id>
13+
<updated>2025-05-18T14:59:17+09:00</updated>
14+
15+
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/map/map/try_emplace.md b/reference/map/map/try_emplace.md
16+
index 7bb94f5dd..498af971b 100644
17+
--- a/reference/map/map/try_emplace.md
18+
+++ b/reference/map/map/try_emplace.md
19+
@@ -55,16 +55,19 @@ iterator
20+
21+
22+
## テンプレートパラメータ制約
23+
-- (1)、(3)、(5) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から `map` に直接構築可能であること
24+
-- (2)、(4)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から `map` に直接構築可能であること
25+
+- (1)、(3)、(5)、(6) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から `map` に直接構築可能であること
26+
+- (2)、(4) : `value_type` は、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から `map` に直接構築可能であること
27+
- (5), (6) : `key_compare::is_transparent` が妥当な式であること
28+
+- (5) : 以下のすべてを満たすこと:
29+
+ - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`&amp;lt;K&amp;amp;&amp;amp;, const_iterator&amp;gt; == false`
30+
+ - [`is_convertible_v`](/reference/type_traits/is_convertible.md)`&amp;lt;K&amp;amp;&amp;amp;, iterator&amp;gt; == false`
31+
32+
なお、規格に記載はないが、`hint` は [`emplace_hint`](emplace_hint.md) と同様、コンテナの有効な読み取り専用イテレータである必要があるものと思われる。
33+
34+
35+
## 効果
36+
-- (1)、(3)、(5) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。
37+
-- (2)、(4)、(6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。
38+
+- (1)、(3)、(5)、(6) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(k)`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。
39+
+- (2)、(4) : `map` が `k` と同値のキーを持つ要素を持っている場合、何もしない(引数への副作用もない)。そうでなければ、[`piecewise_construct`](/reference/utility/piecewise_construct_t.md), [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`move`](/reference/utility/move.md)`(k))`, [`forward_as_tuple`](/reference/tuple/forward_as_tuple.md)`(`[`forward`](/reference/utility/forward.md)`&amp;lt;Args&amp;gt;(args)...)` から構築した `value_type` 型のオブジェクトを挿入する。
40+
41+
42+
## 戻り値
43+
&lt;/code&gt;&lt;/pre&gt;</summary>
44+
45+
<author>
46+
<name>Akira Takahashi</name>
47+
<email>[email protected]</email>
48+
</author>
49+
</entry>
50+
951
<entry>
1052
<title>execution -- execution: continues_on,schedule_from (#1384)</title>
1153
<link href="https://cpprefjp.github.io/reference/execution/execution.html"/>
@@ -1018,165 +1060,6 @@ index 99d6e53ee..eb7b29d3c 100644
10181060
+## 参照
10191061
+- [P2363R5 Extending associative containers with the remaining heterogeneous overloads](http://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2363r5.html)
10201062
+ - C++26で`template &amp;lt;class K&amp;gt;`のバージョンが追加された
1021-
&lt;/code&gt;&lt;/pre&gt;</summary>
1022-
1023-
<author>
1024-
<name>Akira Takahashi</name>
1025-
<email>[email protected]</email>
1026-
</author>
1027-
</entry>
1028-
1029-
<entry>
1030-
<title>宣言のみで使用しない変数の名前として_をサポート [P2169R4] -- ignore : C++26対応として詳細な定義を追加し、例を追加 (close #1315)</title>
1031-
<link href="https://cpprefjp.github.io/lang/cpp26/nice_placeholder_with_no_name.html"/>
1032-
<id>676aba0cd327f2f742d2d3f3bb89c29e08247b74:lang/cpp26/nice_placeholder_with_no_name.md</id>
1033-
<updated>2025-05-15T14:13:05+09:00</updated>
1034-
1035-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/lang/cpp26/nice_placeholder_with_no_name.md b/lang/cpp26/nice_placeholder_with_no_name.md
1036-
index 8e36638dc..e26b12587 100644
1037-
--- a/lang/cpp26/nice_placeholder_with_no_name.md
1038-
+++ b/lang/cpp26/nice_placeholder_with_no_name.md
1039-
@@ -86,6 +86,7 @@ int main() {
1040-
1041-
## &amp;lt;a id=&amp;#34;relative-page&amp;#34; href=&amp;#34;#relative-page&amp;#34;&amp;gt;関連項目&amp;lt;/a&amp;gt;
1042-
- [C++17 `[[maybe_unused]]`属性](/lang/cpp17/maybe_unused.md)
1043-
+- [`std::ignore`](/reference/tuple/ignore.md)
1044-
1045-
## 参照
1046-
- [P2169R4 A nice placeholder with no name](https://open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2169r4.pdf)
1047-
&lt;/code&gt;&lt;/pre&gt;</summary>
1048-
1049-
<author>
1050-
<name>Akira Takahashi</name>
1051-
<email>[email protected]</email>
1052-
</author>
1053-
</entry>
1054-
1055-
<entry>
1056-
<title>ignore -- ignore : C++26対応として詳細な定義を追加し、例を追加 (close #1315)</title>
1057-
<link href="https://cpprefjp.github.io/reference/tuple/ignore.html"/>
1058-
<id>676aba0cd327f2f742d2d3f3bb89c29e08247b74:reference/tuple/ignore.md</id>
1059-
<updated>2025-05-15T14:13:05+09:00</updated>
1060-
1061-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/tuple/ignore.md b/reference/tuple/ignore.md
1062-
index 46b212ca5..8d3d8a3bc 100644
1063-
--- a/reference/tuple/ignore.md
1064-
+++ b/reference/tuple/ignore.md
1065-
@@ -6,8 +6,15 @@
1066-
1067-
```cpp
1068-
namespace std {
1069-
- const unspecified ignore; // C++11
1070-
- inline constexpr unspecified ignore; // C++17
1071-
+ struct ignore-type { // 説明用の定義 (C++26)
1072-
+ constexpr const ignore-type&amp;amp;
1073-
+ operator=(const auto &amp;amp;) const noexcept
1074-
+ { return *this; }
1075-
+ };
1076-
+
1077-
+ const unspecified ignore; // (1) C++11
1078-
+ inline constexpr unspecified ignore; // (1) C++17
1079-
+ inline constexpr ignore-type ignore; // (1) C++26
1080-
}
1081-
```
1082-
* unspecified[italic]
1083-
@@ -15,7 +22,61 @@ namespace std {
1084-
## 概要
1085-
`ignore`は、[`tie()`](tie.md)を使用してタプルから値を抽出する際に、「不要な値」をマーキングするためのプレースホルダーである。
1086-
1087-
-使用例は[`tie()`](tie.md)を参照。
1088-
+そのほか、関数の戻り値を明示的に無視する際にも使用できる。
1089-
+
1090-
+C++26以降は、[`&amp;lt;utility&amp;gt;`](/reference/utility.md)をインクルードして使用することもできる。
1091-
+
1092-
+
1093-
+## 例
1094-
+### タプルの要素を取り出す際に一部の要素を無視する
1095-
+```cpp example
1096-
+#include &amp;lt;iostream&amp;gt;
1097-
+#include &amp;lt;tuple&amp;gt;
1098-
+#include &amp;lt;string&amp;gt;
1099-
+
1100-
+std::tuple&amp;lt;int, char, std::string&amp;gt; f()
1101-
+{
1102-
+ return {1, &amp;#39;a&amp;#39;, &amp;#34;hello&amp;#34;};
1103-
+}
1104-
+
1105-
+int main() {
1106-
+ // char要素は無視する
1107-
+ int a;
1108-
+ std::string c;
1109-
+ std::tie(a, std::ignore, c) = f();
1110-
+
1111-
+ std::cout &amp;lt;&amp;lt; a &amp;lt;&amp;lt; std::endl;
1112-
+ std::cout &amp;lt;&amp;lt; c &amp;lt;&amp;lt; std::endl;
1113-
+}
1114-
+```
1115-
+* std::ignore[color ff0000]
1116-
+
1117-
+#### 出力
1118-
+```
1119-
+1
1120-
+hello
1121-
+```
1122-
+
1123-
+### 関数の戻り値を無視する (C++17)
1124-
+```cpp example
1125-
+#include &amp;lt;iostream&amp;gt;
1126-
+#include &amp;lt;tuple&amp;gt;
1127-
+#include &amp;lt;string&amp;gt;
1128-
+
1129-
+[[nodiscard]]
1130-
+int print_string(std::string s)
1131-
+{
1132-
+ std::cout &amp;lt;&amp;lt; s &amp;lt;&amp;lt; std::endl;
1133-
+ return 0;
1134-
+}
1135-
+
1136-
+int main() {
1137-
+ // 自分の用途ではこの関数は必ず成功するため、
1138-
+ // 戻り値を無視する
1139-
+ std::ignore = print_string(&amp;#34;hello&amp;#34;);
1140-
+}
1141-
+```
1142-
+* std::ignore[color ff0000]
1143-
1144-
1145-
## バージョン
1146-
@@ -33,4 +94,9 @@ namespace std {
1147-
- [`std::make_tuple`](make_tuple.md)
1148-
- [`std::forward_as_tuple`](forward_as_tuple.md)
1149-
- [`std::tie`](tie.md)
1150-
+- [C++17 `[[nodiscard]]`属性](/lang/cpp17/nodiscard.md)
1151-
+- [C++26 宣言のみで使用しない変数の名前として`_`をサポート](/lang/cpp26/nice_placeholder_with_no_name.md)
1152-
+
1153-
1154-
+## 参照
1155-
+- [P2968R2 Make `std::ignore` a first-class object](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2968r2.html)
1156-
&lt;/code&gt;&lt;/pre&gt;</summary>
1157-
1158-
<author>
1159-
<name>Akira Takahashi</name>
1160-
<email>[email protected]</email>
1161-
</author>
1162-
</entry>
1163-
1164-
<entry>
1165-
<title>tie -- ignore : C++26対応として詳細な定義を追加し、例を追加 (close #1315)</title>
1166-
<link href="https://cpprefjp.github.io/reference/tuple/tie.html"/>
1167-
<id>676aba0cd327f2f742d2d3f3bb89c29e08247b74:reference/tuple/tie.md</id>
1168-
<updated>2025-05-15T14:13:05+09:00</updated>
1169-
1170-
<summary type="html">&lt;pre&gt;&lt;code&gt;diff --git a/reference/tuple/tie.md b/reference/tuple/tie.md
1171-
index 255593bd6..949b3494c 100644
1172-
--- a/reference/tuple/tie.md
1173-
+++ b/reference/tuple/tie.md
1174-
@@ -160,4 +160,5 @@ text, b.txt
1175-
1176-
## 参照
1177-
- [LWG2301 Why is std::tie not constexpr?](http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2301)
1178-
+- [P2968R2 Make `std::ignore` a first-class object](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2968r2.html)
1179-
11801063
&lt;/code&gt;&lt;/pre&gt;</summary>
11811064

11821065
<author>

sitemap.xml

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

1490714907
<url>
1490814908
<loc>https://cpprefjp.github.io/reference/map/map/try_emplace.html</loc>
14909-
<lastmod>2025-05-15T15:51:25+09:00</lastmod>
14909+
<lastmod>2025-05-18T14:59:17+09:00</lastmod>
1491014910
<changefreq>daily</changefreq>
1491114911
<priority>0.6</priority>
1491214912
</url>

0 commit comments

Comments
 (0)