22<feed xmlns =" http://www.w3.org/2005/Atom" >
33 <title >cpprefjp - C++日本語リファレンス</title >
44 <link href =" https://cpprefjp.github.io" />
5- <updated >2025-06-04T15:10:16.619675 </updated >
6- <id >5ae80c55-6597-41d2-a28d-995dc6b10882 </id >
5+ <updated >2025-06-04T18:05:34.294268 </updated >
6+ <id >0fbf4552-4e44-4778-996f-aa84e925b0ae </id >
77
88
9+ <entry >
10+ <title >unreachable_sentinel_t -- unreachable_sentinel: 説明を修正</title >
11+ <link href =" https://cpprefjp.github.io/reference/iterator/unreachable_sentinel_t.html" />
12+ <id >c4d5bec557079e03eb029537a59c5b9964d8c5c3:reference/iterator/unreachable_sentinel_t.md</id >
13+ <updated >2025-06-05T03:01:33+09:00</updated >
14+
15+ <summary type =" html" >< pre>< code> diff --git a/reference/iterator/unreachable_sentinel_t.md b/reference/iterator/unreachable_sentinel_t.md
16+ index 4694befc9..15ecfbff8 100644
17+ --- a/reference/iterator/unreachable_sentinel_t.md
18+ +++ b/reference/iterator/unreachable_sentinel_t.md
19+ @@ -19,11 +19,13 @@ namespace std {
20+
21+ ## 概要
22+
23+ -`unreachable_sentinel_t`は、`weakly_incrementable`な型(イテレータ型)とともに用いて、任意の(半)開区間の上界を示すことのできる番兵型である。
24+ +`unreachable_sentinel_t`は、`weakly_incrementable`な型(主にイテレータ型)とともに用いて、非有界な区間の上界を表すことのできる番兵型である。
25+
26+ -検索などを目的として範囲を走査する際、検索対象が範囲内に存在している場合その終端まで到達することは無く、範囲の探索は必ずしも範囲の先頭から行われる訳でも無い。任意の(半)開区間とは、ある範囲の内部にあるその様な走査の対象となる部分範囲のことを指す。`unreachable_sentinel`はその様な区間の終端を暗に指定する、その様な開区間の上界を表す番兵である。
27+ +非有界な区間とは無限長の範囲のように、その終端が指定されない区間(範囲)のこと。そのような範囲の走査に対して`unreachable_sentinel`を使用して、別の方法によって範囲の終端が示されることを表し、それによって区間の上界を指定することができる。
28+
29+ -検索など、ある範囲の一部を走査する際にそのイテレータに対する番兵として用いる事で、範囲の終端チェックを省略して走査を効率化できる可能性がある。ただし、実際の終端に到達しても走査が終了しないため、利用にあたっては事前条件(終端となる値が存在しているか)が必ず満たされるかに注意を払う必要がある。
30+ +1つの使い方は、無限長の範囲や`view`の番兵型として指定することで、その長さが無制限であることを表すことである。[`views::iota`](/reference/ranges/iota_view.md)や[`views::repeat`](/reference/ranges/repeat_view.md)でそのような使用方法を見ることができる。
31+ +
32+ +もう一つの使い方として、検索などにおいてある範囲の一部を走査する際にそのイテレータに対する番兵として用いる事で、範囲の終端チェックを省略して走査を効率化できる可能性がある。ただし、実際の終端に到達しても走査が終了しないため、利用にあたっては事前条件(終端となる値が存在しているか)が必ず満たされるかに注意を払う必要がある。
33+
34+ ## 非メンバ(*Hidden friends*)関数
35+
36+ < /code>< /pre> </summary >
37+
38+ <author >
39+ <name >onihusube</name >
40+ 41+ </author >
42+ </entry >
43+
944 <entry >
1045 <title >base -- meta header修正</title >
1146 <link href =" https://cpprefjp.github.io/reference/ranges/to_input_view/base.html" />
@@ -1606,222 +1641,4 @@ index 53d93ab59..68310616e 100644
16061641 </author >
16071642 </entry >
16081643
1609- <entry >
1610- <title >uses_allocator_construction_args -- uses_allocator_construction_args : C++23対応 #1063</title >
1611- <link href =" https://cpprefjp.github.io/reference/memory/uses_allocator_construction_args.html" />
1612- <id >3aa3df84dafc10d7c0cdaf55ae0bbb82296bb4f9:reference/memory/uses_allocator_construction_args.md</id >
1613- <updated >2025-06-04T14:08:03+09:00</updated >
1614-
1615- <summary type =" html" >< pre>< code> diff --git a/reference/memory/uses_allocator_construction_args.md b/reference/memory/uses_allocator_construction_args.md
1616- index 133a4af45..1efdcafdc 100644
1617- --- a/reference/memory/uses_allocator_construction_args.md
1618- +++ b/reference/memory/uses_allocator_construction_args.md
1619- @@ -5,29 +5,73 @@
1620- * cpp20[meta cpp]
1621-
1622- ```cpp
1623- -template& lt;class T, class Alloc, class... Args& gt;
1624- - auto uses_allocator_construction_args(const Alloc& amp; alloc, Args& amp;& amp;... args) -& gt; see below; // (1)
1625- -
1626- -template& lt;class T, class Alloc, class Tuple1, class Tuple2& gt;
1627- - auto uses_allocator_construction_args(const Alloc& amp; alloc, piecewise_construct_t,
1628- - Tuple1& amp;& amp; x, Tuple2& amp;& amp; y) -& gt; see below; // (2)
1629- -
1630- -template& lt;class T, class Alloc& gt;
1631- - auto uses_allocator_construction_args(const Alloc& amp; alloc) -& gt; see below; // (3)
1632- -
1633- -template& lt;class T, class Alloc, class U, class V& gt;
1634- - auto uses_allocator_construction_args(const Alloc& amp; alloc, U& amp;& amp; u, V& amp;& amp; v) -& gt; see below; // (4)
1635- -
1636- -template& lt;class T, class Alloc, class U, class V& gt;
1637- - auto uses_allocator_construction_args(const Alloc& amp; alloc, const pair& lt;U, V& gt;& amp; pr) -& gt; see below; // (5)
1638- -
1639- -template& lt;class T, class Alloc, class U, class V& gt;
1640- - auto uses_allocator_construction_args(const Alloc& amp; alloc, pair& lt;U, V& gt;& amp;& amp; pr) -& gt; see below; // (6)
1641- +template & lt;class T, class Alloc, class... Args& gt;
1642- +constexpr auto
1643- + uses_allocator_construction_args(
1644- + const Alloc& amp; alloc,
1645- + Args& amp;& amp;... args) -& gt; see below; // (1) C++20
1646- +
1647- +template & lt;class T, class Alloc, class Tuple1, class Tuple2& gt;
1648- +constexpr auto
1649- + uses_allocator_construction_args(
1650- + const Alloc& amp; alloc,
1651- + piecewise_construct_t,
1652- + Tuple1& amp;& amp; x,
1653- + Tuple2& amp;& amp; y) -& gt; see below; // (2) C++20
1654- +
1655- +template & lt;class T, class Alloc& gt;
1656- +constexpr auto
1657- + uses_allocator_construction_args(
1658- + const Alloc& amp; alloc) -& gt; see below; // (3) C++20
1659- +
1660- +template & lt;class T, class Alloc, class U, class V& gt;
1661- +constexpr auto
1662- + uses_allocator_construction_args(
1663- + const Alloc& amp; alloc,
1664- + U& amp;& amp; u,
1665- + V& amp;& amp; v) -& gt; see below; // (4) C++20
1666- +
1667- +template & lt;class T, class Alloc, class U, class V& gt;
1668- +constexpr auto
1669- + uses_allocator_construction_args(
1670- + const Alloc& amp; alloc,
1671- + pair& lt;U,V& gt;& amp; pr) noexcept; // (5) C++23
1672- +
1673- +template & lt;class T, class Alloc, class U, class V& gt;
1674- +constexpr auto
1675- + uses_allocator_construction_args(
1676- + const Alloc& amp; alloc,
1677- + const pair& lt;U, V& gt;& amp; pr) -& gt; see below; // (6) C++20
1678- +
1679- +template & lt;class T, class Alloc, class U, class V& gt;
1680- +constexpr auto
1681- + uses_allocator_construction_args(
1682- + const Alloc& amp; alloc,
1683- + pair& lt;U, V& gt;& amp;& amp; pr) -& gt; see below; // (7) C++20
1684- +
1685- +template & lt;class T, class Alloc, class U, class V& gt;
1686- +constexpr auto
1687- + uses_allocator_construction_args(
1688- + const Alloc& amp; alloc,
1689- + const pair& lt;U,V& gt;& amp;& amp; pr) noexcept; // (8) C++23
1690- +
1691- +template & lt;class T, class Alloc, pair-like P& gt;
1692- +constexpr auto
1693- + uses_allocator_construction_args(
1694- + const Alloc& amp; alloc,
1695- + P& amp;& amp; p) noexcept; // (9) C++23
1696- +
1697- +template & lt;class T, class Alloc, class U& gt;
1698- +constexpr auto
1699- + uses_allocator_construction_args(
1700- + const Alloc& amp; alloc,
1701- + U& amp;& amp; u) noexcept; // (10) C++23
1702- ```
1703- * see below[italic]
1704-
1705- ## 概要
1706- `Alloc` 型のアロケータオブジェクト `alloc` を使用した `T` 型オブジェクトの uses-allocator 構築のために必要なコンストラクタ引数を、[`tuple`](../tuple/tuple.md) 型にして返す。
1707- +
1708- また、`T` が [`pair`](../utility/pair.md) だった場合は、それぞれの要素に対して uses-allocator 構築するために必要なコンストラクタ引数を、[`tuple`](../tuple/tuple.md) 型にして返す。
1709-
1710- 構築対象の型 `T` は関数引数からは推論できないため、明示的に指定する必要がある。
1711- @@ -35,11 +79,15 @@ template& lt;class T, class Alloc, class U, class V& gt;
1712-
1713- ## テンプレートパラメータ制約
1714- - (1) : `T` が [`pair`](../utility/pair.md) の特殊化**ではない**場合のみオーバーロード解決に参加する
1715- -- (2)-(6) : `T` が [`pair`](../utility/pair.md) の特殊化**である**場合のみオーバーロード解決に参加する
1716- +- (2)-(10) : `T` が [`pair`](../utility/pair.md) の特殊化**である**場合のみオーバーロード解決に参加する
1717- +- (9) : `P`が[`std::ranges::subrange`](/reference/ranges/subrange.md)の特殊化である場合のみオーバーロード解決に参加する
1718- +- (10) : 以下のいずれかを満たす場合のみオーバーロード解決に参加する
1719- + - `P`が[`std::ranges::subrange`](/reference/ranges/subrange.md)の特殊化であること。もしくは
1720- + - `U`が`pair-like`の要件を満たさず、関数`template& lt;class A, class B& gt; void FUN (const pair& lt;A, B& gt;& amp;);`に`FUN(u)`した場合に適格ではないこと
1721-
1722-
1723- ## 戻り値
1724- -- (1) : 以下のいずれかと同等
1725- +- (1) : 以下のいずれかと等価
1726- - もし [`uses_allocator_v`](uses_allocator.md)`& lt;T, Alloc& gt;` が `false` で、かつ、[`is_constructible_v`](../type_traits/is_constructible.md)`& lt;T, Args...& gt;` が `true` の場合、
1727-
1728- ```cpp
1729- @@ -69,7 +117,7 @@ forward_as_tuple(std::forward& lt;Args& gt;(args)..., alloc)
1730-
1731- - 上記以外の場合、不適格となる。
1732-
1733- -- (2) : `T` を [`pair`](../utility/pair.md)`& lt;T1, T2& gt;` とすると、以下と同等
1734- +- (2) : `T` を [`pair`](../utility/pair.md)`& lt;T1, T2& gt;` とすると、以下と等価
1735-
1736- ```cpp
1737- make_tuple(
1738- @@ -89,7 +137,7 @@ make_tuple(
1739- * apply[link ../tuple/apply.md]
1740- * make_tuple[link ../tuple/make_tuple.md]
1741-
1742- -- (3) : 以下と同等
1743- +- (3) : 以下と等価
1744-
1745- ```cpp
1746- uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1747- @@ -99,7 +147,7 @@ uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1748- * tuple[link ../tuple/tuple/op_constructor.md]
1749- * uses_allocator_construction_args[color ff0000]
1750-
1751- -- (4) : 以下と同等
1752- +- (4) : 以下と等価
1753-
1754- ```cpp
1755- uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1756- @@ -111,7 +159,7 @@ uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1757- * forward[link ../utility/forward.md]
1758- * uses_allocator_construction_args[color ff0000]
1759-
1760- -- (5) : 以下と同等
1761- +- (5), (6) : 以下と等価
1762-
1763- ```cpp
1764- uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1765- @@ -122,7 +170,7 @@ uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1766- * forward_as_tuple[link ../tuple/forward_as_tuple.md]
1767- * uses_allocator_construction_args[color ff0000]
1768-
1769- -- (6) : 以下と同等
1770- +- (7), (8) : 以下と等価
1771-
1772- ```cpp
1773- uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1774- @@ -134,6 +182,39 @@ uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1775- * move[link ../utility/move.md]
1776- * uses_allocator_construction_args[color ff0000]
1777-
1778- +- (9) : 以下と等価
1779- +
1780- + ```cpp
1781- +return uses_allocator_construction_args& lt;T& gt;(alloc, piecewise_construct,
1782- + forward_as_tuple(get& lt;0& gt;(std::forward& lt;P& gt;(p))),
1783- + forward_as_tuple(get& lt;1& gt;(std::forward& lt;P& gt;(p))));
1784- +```
1785- +* piecewise_construct[link ../utility/piecewise_construct_t.md]
1786- +* forward_as_tuple[link ../tuple/forward_as_tuple.md]
1787- +
1788- +- (10) : 以下の説明用クラスを定義し、
1789- + ```cpp
1790- + class pair-constructor {
1791- + using pair-type = remove_cv_t& lt;T& gt;;
1792- + constexpr auto do-construct(const pair-type& amp; p) const {
1793- + return make_obj_using_allocator& lt;pair-type& gt;(alloc_, p);
1794- + }
1795- +
1796- + constexpr auto do-construct(pair-type& amp;& amp; p) const {
1797- + return make_obj_using_allocator& lt;pair-type& gt;(alloc_, std::move(p));
1798- + }
1799- +
1800- + const Alloc& amp; alloc_;
1801- + U& amp; u_;
1802- + public:
1803- + constexpr operator pair-type() const {
1804- + return do-construct(std::forward& lt;U& gt;(u_));
1805- + }
1806- + };
1807- + ```
1808- +
1809- + - `u`で`u_`、`alloc`で`alloc_`初期化した`pair-constructor`オブジェクト`pc`を生成し、`make_tuple(pc)`を返す
1810- +
1811-
1812- ## 備考
1813- - 本関数は、uses-allocator 構築をサポートするために C++20 で導入された。
1814- @@ -248,3 +329,4 @@ tuple(piecewise_construct_t, tuple(allocator_arg_t, MyAlloc, 3, ), tuple(4, MyAl
1815-
1816- ## 参照
1817- - [P0591R4 Utility functions to implement uses-allocator construction](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0591r4.pdf)
1818- +- [P2321R2 zip](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html)
1819- < /code>< /pre> </summary >
1820-
1821- <author >
1822- <name >Akira Takahashi</name >
1823- 1824- </author >
1825- </entry >
1826-
18271644</feed >
0 commit comments