|
2 | 2 | <feed xmlns="http://www.w3.org/2005/Atom">
|
3 | 3 | <title>cpprefjp - C++日本語リファレンス</title>
|
4 | 4 | <link href="https://cpprefjp.github.io" />
|
5 |
| - <updated>2024-08-09T05:33:45.871996</updated> |
6 |
| - <id>eb2ca355-9765-4d74-a7d9-36af72d16d38</id> |
| 5 | + <updated>2024-08-09T05:39:51.576625</updated> |
| 6 | + <id>7b51b134-f14b-45e1-9385-3ada41d11478</id> |
7 | 7 |
|
8 | 8 |
|
| 9 | + <entry> |
| 10 | + <title>generate_random -- generate_random : 出力 → 出力例</title> |
| 11 | + <link href="https://cpprefjp.github.io/reference/random/generate_random.html"/> |
| 12 | + <id>c8d18a6d28b575d1a8c80c7d435cf6beafc2b3d7:reference/random/generate_random.md</id> |
| 13 | + <updated>2024-08-09T14:36:39+09:00</updated> |
| 14 | + |
| 15 | + <summary type="html"><pre><code>diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md |
| 16 | +index acec6c269..b13fab2c8 100644 |
| 17 | +--- a/reference/random/generate_random.md |
| 18 | ++++ b/reference/random/generate_random.md |
| 19 | +@@ -143,7 +143,7 @@ int main() |
| 20 | + * std::ranges::generate_random[color ff0000] |
| 21 | + * std::uniform_int_distribution[link uniform_int_distribution.md] |
| 22 | + |
| 23 | +-### 出力 |
| 24 | ++### 出力例 |
| 25 | + ``` |
| 26 | + [2034091041, 1919373608, 514210727, -1154669807, -315048337, -1224623446, -1986406128, -1034429876, -844125616, 1858136340] |
| 27 | + [83, 25, 48, 15, 9, 60, 47, 31, 91, 54] |
| 28 | +</code></pre></summary> |
| 29 | + |
| 30 | + <author> |
| 31 | + <name>Akira Takahashi</name> |
| 32 | + |
| 33 | + </author> |
| 34 | + </entry> |
| 35 | + |
| 36 | + <entry> |
| 37 | + <title>generate_random -- generate_random : コード修飾を追加</title> |
| 38 | + <link href="https://cpprefjp.github.io/reference/random/generate_random.html"/> |
| 39 | + <id>b4085cfb1d2ea9e4f82a862ac91a05db0cf20195:reference/random/generate_random.md</id> |
| 40 | + <updated>2024-08-09T14:35:58+09:00</updated> |
| 41 | + |
| 42 | + <summary type="html"><pre><code>diff --git a/reference/random/generate_random.md b/reference/random/generate_random.md |
| 43 | +index 32765abfd..acec6c269 100644 |
| 44 | +--- a/reference/random/generate_random.md |
| 45 | ++++ b/reference/random/generate_random.md |
| 46 | +@@ -74,6 +74,7 @@ for (auto&amp; x : v) { |
| 47 | + x = dist(gen); |
| 48 | + } |
| 49 | + ``` |
| 50 | ++* std::uniform_int_distribution[link uniform_int_distribution.md] |
| 51 | + |
| 52 | + |
| 53 | + ## 効果 |
| 54 | +@@ -140,6 +141,7 @@ int main() |
| 55 | + } |
| 56 | + ``` |
| 57 | + * std::ranges::generate_random[color ff0000] |
| 58 | ++* std::uniform_int_distribution[link uniform_int_distribution.md] |
| 59 | + |
| 60 | + ### 出力 |
| 61 | + ``` |
| 62 | +</code></pre></summary> |
| 63 | + |
| 64 | + <author> |
| 65 | + <name>Akira Takahashi</name> |
| 66 | + |
| 67 | + </author> |
| 68 | + </entry> |
| 69 | + |
9 | 70 | <entry>
|
10 | 71 | <title>generate_random -- generate_random : コード修飾を修正</title>
|
11 | 72 | <link href="https://cpprefjp.github.io/reference/random/generate_random.html"/>
|
@@ -777,275 +838,6 @@ index 000000000..d809d08ef
|
777 | 838 | +
|
778 | 839 | +## 参照
|
779 | 840 | +- [P1068R11 Vector API for random number generation](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p1068r11.pdf)
|
780 |
| -</code></pre></summary> |
781 |
| - |
782 |
| - <author> |
783 |
| - <name>Akira Takahashi</name> |
784 |
| - |
785 |
| - </author> |
786 |
| - </entry> |
787 |
| - |
788 |
| - <entry> |
789 |
| - <title>polymorphic_allocator -- polymorphic_allocator : C++26対応としてdestroyの非推奨を取り消し (close #1330)</title> |
790 |
| - <link href="https://cpprefjp.github.io/reference/memory_resource/polymorphic_allocator.html"/> |
791 |
| - <id>0eca2a433b8581d5dfdc389d1c933da3fa973931:reference/memory_resource/polymorphic_allocator.md</id> |
792 |
| - <updated>2024-08-09T13:35:29+09:00</updated> |
793 |
| - |
794 |
| - <summary type="html"><pre><code>diff --git a/reference/memory_resource/polymorphic_allocator.md b/reference/memory_resource/polymorphic_allocator.md |
795 |
| -index 3ee66e2c6..3ca17d2c5 100644 |
796 |
| ---- a/reference/memory_resource/polymorphic_allocator.md |
797 |
| -+++ b/reference/memory_resource/polymorphic_allocator.md |
798 |
| -@@ -46,7 +46,7 @@ C++20にてC++プログラミングにおいての基礎部品となる型(*vo |
799 |
| - | 名前 | 説明 | 対応バージョン | |
800 |
| - |-----------------|----------------|----------------| |
801 |
| - | [`construct`](polymorphic_allocator/construct.md) | 指定された領域にオブジェクトを構築する | C++17 | |
802 |
| --| [`destroy`](polymorphic_allocator/destroy.md) | 指定された領域のオブジェクトを破棄する | C++17&lt;br/&gt;C++20より非推奨 | |
803 |
| -+| [`destroy`](polymorphic_allocator/destroy.md) | 指定された領域のオブジェクトを破棄する | C++17 | |
804 |
| - | [`new_object`](polymorphic_allocator/new_object.md) | メモリを確保し指定した型の構築(`new`式相当の処理)を行う | C++20 | |
805 |
| - | [`delete_object`](polymorphic_allocator/delete_object.md) | 指定した型の破棄とそのメモリ領域の解放(`delete`式相当の処理)を行う | C++20 | |
806 |
| - |
807 |
| -</code></pre></summary> |
808 |
| - |
809 |
| - <author> |
810 |
| - <name>Akira Takahashi</name> |
811 |
| - |
812 |
| - </author> |
813 |
| - </entry> |
814 |
| - |
815 |
| - <entry> |
816 |
| - <title>destroy -- polymorphic_allocator : C++26対応としてdestroyの非推奨を取り消し (close #1330)</title> |
817 |
| - <link href="https://cpprefjp.github.io/reference/memory_resource/polymorphic_allocator/destroy.html"/> |
818 |
| - <id>0eca2a433b8581d5dfdc389d1c933da3fa973931:reference/memory_resource/polymorphic_allocator/destroy.md</id> |
819 |
| - <updated>2024-08-09T13:35:29+09:00</updated> |
820 |
| - |
821 |
| - <summary type="html"><pre><code>diff --git a/reference/memory_resource/polymorphic_allocator/destroy.md b/reference/memory_resource/polymorphic_allocator/destroy.md |
822 |
| -index 81cf4cac0..2ed3166a3 100644 |
823 |
| ---- a/reference/memory_resource/polymorphic_allocator/destroy.md |
824 |
| -+++ b/reference/memory_resource/polymorphic_allocator/destroy.md |
825 |
| -@@ -4,16 +4,12 @@ |
826 |
| - * std::pmr[meta namespace] |
827 |
| - * polymorphic_allocator[meta class] |
828 |
| - * cpp17[meta cpp] |
829 |
| --* cpp20deprecated[meta cpp] |
830 |
| - |
831 |
| - ```cpp |
832 |
| - template &lt;class T&gt; |
833 |
| - void destroy(T* p); |
834 |
| - ``` |
835 |
| - |
836 |
| --この関数はC++20で非推奨となった。不要な機能ではあるが、代わりが必要であれば[`allocator_traits&lt;Alloc&gt;::destroy()`](/reference/memory/allocator_traits/destroy.md)もしくは[`destroy_at()`](/reference/memory/destroy_at.md)を使用すること。 |
837 |
| -- |
838 |
| -- |
839 |
| - ## 概要 |
840 |
| - 指定された領域にある`T`のオブジェクトを破棄する。 |
841 |
| - |
842 |
| -@@ -25,15 +21,6 @@ void destroy(T* p); |
843 |
| - |
844 |
| - メモリ領域の解放は行われないため、別に[`deallocate`](deallocate.md)で行う必要がある。 |
845 |
| - |
846 |
| --## 非推奨の詳細 |
847 |
| -- |
848 |
| --`polymorphic_allocator`も含めたアロケータはコンテナから利用される際に`allocator_traits`を介して利用され、`allocator_traits`の提供するデフォルト実装によってアロケータとしての多くの部分が補われる。 |
849 |
| -- |
850 |
| --本関数は、[`allocator_traits&lt;Alloc&gt;::destroy()`](/reference/memory/allocator_traits/destroy.md)で提供されているデフォルト実装と完全に同一の実装となっており、追加の事を何もしていない。従って有用性は何もなく、非推奨とされた。 |
851 |
| -- |
852 |
| --おそらく、[`construct()`](construct.md)メンバ関数との対称性を意識して追加されていたものと思われる。なお、`construct()`メンバ関数は[uses-allocator 構築](/reference/memory/uses_allocator.md)のために追加の仕事を担っており、こちらの関数には有用であるため非推奨とはされていない。 |
853 |
| -- |
854 |
| --`allocator_traits`を介して`polymorphic_allocator`を使用する場合は本関数の有無を気にする必要はないが、もし本関数が必要となった場合は代わりに[`destroy_at()`](/reference/memory/destroy_at.md)を利用できる。 |
855 |
| - |
856 |
| - ## 例 |
857 |
| - ```cpp example |
858 |
| -@@ -98,3 +85,5 @@ int main() |
859 |
| - - [Working Draft, C++ Extensions for Library Fundamentals, Version 2](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4562.html#memory.resource.synop) |
860 |
| - - [destroy: Missing member function of std::pmr::polymorphic_allocator - Developer Community](https://developercommunity.visualstudio.com/content/problem/394908/destroy-missing-member-function-of-stdpmrpolymorph.html) |
861 |
| - - [LWG Issue 3036. `polymorphic_allocator::destroy` is extraneous](https://cplusplus.github.io/LWG/issue3036) |
862 |
| -+- [P2875R4 Undeprecate `polymorphic_allocator::destroy` for C++26](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2875r4.pdf) |
863 |
| -+ - この関数はC++20で一度非推奨となったが、C++26で非推奨が取り消された。ただし、[`allocator_traits&lt;Alloc&gt;::destroy()`](/reference/memory/allocator_traits/destroy.md)関数や[`destroy_at()`](/reference/memory/destroy_at.md)関数で同等のことができる |
864 |
| -</code></pre></summary> |
865 |
| - |
866 |
| - <author> |
867 |
| - <name>Akira Takahashi</name> |
868 |
| - |
869 |
| - </author> |
870 |
| - </entry> |
871 |
| - |
872 |
| - <entry> |
873 |
| - <title>println -- println : C++26対応として、改行コードのみを出力するオーバーロードを追加 (close #1335)</title> |
874 |
| - <link href="https://cpprefjp.github.io/reference/ostream/println.html"/> |
875 |
| - <id>a485eae4372c5cc76f55f1480fb417b244354c59:reference/ostream/println.md</id> |
876 |
| - <updated>2024-08-09T13:03:48+09:00</updated> |
877 |
| - |
878 |
| - <summary type="html"><pre><code>diff --git a/reference/ostream/println.md b/reference/ostream/println.md |
879 |
| -index f5fee4e20..1d1bcbe68 100644 |
880 |
| ---- a/reference/ostream/println.md |
881 |
| -+++ b/reference/ostream/println.md |
882 |
| -@@ -10,6 +10,8 @@ namespace std { |
883 |
| - void println(ostream&amp; os, |
884 |
| - format_string&lt;Args...&gt; fmt, |
885 |
| - Args&amp;&amp;... args); // (1) C++23 |
886 |
| -+ |
887 |
| -+ void println(ostream&amp; os); // (2) C++26 |
888 |
| - } |
889 |
| - ``` |
890 |
| - * format_string[link /reference/format/basic_format_string.md] |
891 |
| -@@ -23,6 +25,7 @@ namespace std { |
892 |
| - この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 |
893 |
| - |
894 |
| - - (1) : 指定した[`ostream`](basic_ostream.md)に、書式指定で出力する |
895 |
| -+- (2) : 指定した[`ostream`](basic_ostream.md)に、改行コードを出力する |
896 |
| - |
897 |
| - この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 |
898 |
| - |
899 |
| -@@ -38,6 +41,12 @@ namespace std { |
900 |
| - * format[link /reference/format/format.md] |
901 |
| - * std::forward[link /reference/utility/forward.md] |
902 |
| - |
903 |
| -+- (2) : 以下と等価: |
904 |
| -+ ```cpp |
905 |
| -+ print(os, &#34;\n&#34;); |
906 |
| -+ ``` |
907 |
| -+ * print[link print.md] |
908 |
| -+ |
909 |
| - |
910 |
| - ## 例 |
911 |
| - ### 基本的な使い方 |
912 |
| -@@ -75,6 +84,27 @@ int main() |
913 |
| - Hello |
914 |
| - ``` |
915 |
| - |
916 |
| -+### 改行コードを出力する (C++26) |
917 |
| -+```cpp example |
918 |
| -+#include &lt;iostream&gt; |
919 |
| -+ |
920 |
| -+int main() |
921 |
| -+{ |
922 |
| -+ std::print(std::cout, &#34;abc&#34;); |
923 |
| -+ std::println(std::cout, ); // 改行コードのみを出力する |
924 |
| -+ std::print(std::cout, &#34;{}&#34;, 123); |
925 |
| -+ std::println(std::cout, ); |
926 |
| -+} |
927 |
| -+``` |
928 |
| -+* std::print[link print.md] |
929 |
| -+ |
930 |
| -+#### 出力 |
931 |
| -+``` |
932 |
| -+abc |
933 |
| -+123 |
934 |
| -+``` |
935 |
| -+ |
936 |
| -+ |
937 |
| - ## バージョン |
938 |
| - ### 言語 |
939 |
| - - C++23 |
940 |
| -@@ -94,3 +124,4 @@ Hello |
941 |
| - |
942 |
| - ## 参照 |
943 |
| - - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) |
944 |
| -+- [P3142R0 Printing Blank Lines with `println`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3142r0.pdf) |
945 |
| -</code></pre></summary> |
946 |
| - |
947 |
| - <author> |
948 |
| - <name>Akira Takahashi</name> |
949 |
| - |
950 |
| - </author> |
951 |
| - </entry> |
952 |
| - |
953 |
| - <entry> |
954 |
| - <title>println -- println : C++26対応として、改行コードのみを出力するオーバーロードを追加 (close #1335)</title> |
955 |
| - <link href="https://cpprefjp.github.io/reference/print/println.html"/> |
956 |
| - <id>a485eae4372c5cc76f55f1480fb417b244354c59:reference/print/println.md</id> |
957 |
| - <updated>2024-08-09T13:03:48+09:00</updated> |
958 |
| - |
959 |
| - <summary type="html"><pre><code>diff --git a/reference/print/println.md b/reference/print/println.md |
960 |
| -index 8fd358046..67830f962 100644 |
961 |
| ---- a/reference/print/println.md |
962 |
| -+++ b/reference/print/println.md |
963 |
| -@@ -10,10 +10,14 @@ namespace std { |
964 |
| - void println(format_string&lt;Args...&gt; fmt, |
965 |
| - Args&amp;&amp;... args); // (1) C++23 |
966 |
| - |
967 |
| -+ void println(); // (2) C++26 |
968 |
| -+ |
969 |
| - template &lt;class... Args&gt; |
970 |
| - void println(FILE* stream, |
971 |
| - format_string&lt;Args...&gt; fmt, |
972 |
| -- Args&amp;&amp;... args); // (2) C++23 |
973 |
| -+ Args&amp;&amp;... args); // (3) C++23 |
974 |
| -+ |
975 |
| -+ void println(FILE* stream); // (4) C++26 |
976 |
| - } |
977 |
| - ``` |
978 |
| - * format_string[link /reference/format/basic_format_string.md] |
979 |
| -@@ -27,7 +31,9 @@ namespace std { |
980 |
| - この関数は、[`std::printf()`](/reference/cstdio/printf.md.nolink)関数ライクな書式指定で引数を文字列化して出力する。 |
981 |
| - |
982 |
| - - (1) : 標準出力に、書式指定で出力する |
983 |
| --- (2) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する |
984 |
| -+- (2) : 標準出力に改行コードを出力する |
985 |
| -+- (3) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、書式指定で出力する |
986 |
| -+- (4) : 指定された[`FILE`](/reference/cstdio/file.md.nolink)に、改行コードを出力する |
987 |
| - |
988 |
| - この関数は、末尾に改行コードが付くことに注意。改行コードが不要な場合は、[`std::print()`](print.md)関数を使用すること。 |
989 |
| - |
990 |
| -@@ -43,6 +49,12 @@ namespace std { |
991 |
| - * std::forward[link /reference/utility/forward.md] |
992 |
| - |
993 |
| - - (2) : 以下と等価: |
994 |
| -+ ```cpp |
995 |
| -+ println(stdout); |
996 |
| -+ ``` |
997 |
| -+ * stdout[link /reference/cstdio/stdout.md.nolink] |
998 |
| -+ |
999 |
| -+- (3) : 以下と等価: |
1000 |
| - ```cpp |
1001 |
| - print(stream, &#34;{}\n&#34;, format(fmt, std::forward&lt;Args&gt;(args)...)); |
1002 |
| - ``` |
1003 |
| -@@ -50,6 +62,12 @@ namespace std { |
1004 |
| - * format[link /reference/format/format.md] |
1005 |
| - * std::forward[link /reference/utility/forward.md] |
1006 |
| - |
1007 |
| -+- (4) : 以下と等価: |
1008 |
| -+ ```cpp |
1009 |
| -+ print(stream, &#34;\n&#34;); |
1010 |
| -+ ``` |
1011 |
| -+ * print[link print.md] |
1012 |
| -+ |
1013 |
| - |
1014 |
| - ## 例 |
1015 |
| - ### 基本的な使い方 |
1016 |
| -@@ -113,6 +131,27 @@ int main() |
1017 |
| - Hello |
1018 |
| - ``` |
1019 |
| - |
1020 |
| -+ |
1021 |
| -+### 改行コードを出力する (C++26) |
1022 |
| -+```cpp example |
1023 |
| -+#include &lt;print&gt; |
1024 |
| -+ |
1025 |
| -+int main() |
1026 |
| -+{ |
1027 |
| -+ std::print(&#34;abc&#34;); |
1028 |
| -+ std::println(); // 改行コードのみを出力する |
1029 |
| -+ std::print(&#34;{}&#34;, 123); |
1030 |
| -+ std::println(); |
1031 |
| -+} |
1032 |
| -+``` |
1033 |
| -+* std::print[link print.md] |
1034 |
| -+ |
1035 |
| -+#### 出力 |
1036 |
| -+``` |
1037 |
| -+abc |
1038 |
| -+123 |
1039 |
| -+``` |
1040 |
| -+ |
1041 |
| - ## バージョン |
1042 |
| - ### 言語 |
1043 |
| - - C++23 |
1044 |
| -@@ -132,3 +171,4 @@ Hello |
1045 |
| - |
1046 |
| - ## 参照 |
1047 |
| - - [P2093R14 Formatted output](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2093r14.html) |
1048 |
| -+- [P3142R0 Printing Blank Lines with `println`](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3142r0.pdf) |
1049 | 841 | </code></pre></summary>
|
1050 | 842 |
|
1051 | 843 | <author>
|
|
0 commit comments