xref: /netbsd-src/external/gpl3/gcc/dist/libstdc++-v3/doc/xml/manual/status_cxx2023.xml (revision b1e838363e3c6fc78a55519254d99869742dd33c)
1<section xmlns="http://docbook.org/ns/docbook" version="5.0"
2   xml:id="status.iso.2023" xreflabel="Status C++ 2023">
3<?dbhtml filename="status_iso_cxx2023.html"?>
4
5<info><title>C++ 2023</title>
6  <keywordset>
7    <keyword>ISO C++</keyword>
8    <keyword>2023</keyword>
9  </keywordset>
10</info>
11
12<para>
13In this implementation the <literal>-std=gnu++23</literal> or
14<literal>-std=c++23</literal> flag must be used to enable language
15and library
16features. See <link linkend="manual.intro.using.flags">dialect</link>
17options. The pre-defined symbol
18<constant>__cplusplus</constant> is used to check for the
19presence of the required flag.
20</para>
21
22<para>
23This section describes the C++23 and library TS support in mainline GCC,
24not in any particular release.
25</para>
26
27<para>
28The following table lists new library features that have been accepted into
29the C++23 working draft. The "Proposal" column provides a link to the
30ISO C++ committee proposal that describes the feature, while the "Status"
31column indicates the first version of GCC that contains an implementation of
32this feature (if it has been implemented).
33A dash (&#x2014;) in the status column indicates that the changes in the proposal
34either do not affect the code in libstdc++, or the changes are not required for conformance.
35The "SD-6 Feature Test / Notes" column shows the corresponding macro or header from
36<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">SD-6:
37Feature-testing recommendations for C++</link> (where applicable)
38or any notes about the implementation.
39</para>
40
41<table frame="all" xml:id="table.cxx23_features">
42<title>C++ 2023 Library Features</title>
43
44<tgroup cols="4" align="left" colsep="0" rowsep="1">
45<colspec colname="c1"/>
46<colspec colname="c2"/>
47<colspec colname="c3"/>
48<colspec colname="c4"/>
49  <thead>
50    <row>
51      <entry>Library Feature</entry>
52      <entry>Proposal</entry>
53      <entry>Status</entry>
54      <entry>SD-6 Feature Test / Notes</entry>
55    </row>
56  </thead>
57
58  <tbody>
59
60    <row>
61      <entry namest="c1" nameend="c4" align="left">
62        <emphasis role="bold">Ranges and Views</emphasis>
63      </entry>
64    </row>
65
66    <row>
67      <entry> Range constructor for std::string_view </entry>
68      <entry>
69        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1989r2.pdf">
70        P1989R2
71        </link>
72      </entry>
73      <entry align="center"> 11.1 </entry>
74      <entry />
75    </row>
76
77    <row>
78      <entry> <code>join_view</code> should join all views of ranges </entry>
79      <entry>
80        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2328r1.html">
81        P2328R1
82        </link>
83      </entry>
84      <entry align="center"> 11.2 </entry>
85      <entry />
86    </row>
87
88
89    <row>
90      <entry> Clarifying range adaptor objects </entry>
91      <entry>
92        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2281r1.html">
93        P2281R1
94        </link>
95      </entry>
96      <entry align="center"> 11.1 </entry>
97      <entry />
98    </row>
99
100    <row>
101      <entry> Views should not be required to be default constructible </entry>
102      <entry>
103        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2325r3.html">
104        P2325R3
105        </link>
106      </entry>
107      <entry align="center"> 11.3 </entry>
108      <entry> <code>__cpp_lib_ranges &gt;= 202106L</code> </entry>
109    </row>
110
111    <row>
112      <entry> Conditionally borrowed ranges </entry>
113      <entry>
114        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2017r1.html">
115        P2017R1
116        </link>
117      </entry>
118      <entry align="center"> 11.1 </entry>
119      <entry />
120    </row>
121
122    <row>
123      <entry> Require <code>span</code> &amp; <code>basic_string_view</code> to be Trivially Copyable </entry>
124      <entry>
125        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2251r1.pdf">
126        P2251R1
127        </link>
128      </entry>
129      <entry align="center"> Yes </entry>
130      <entry />
131    </row>
132
133    <row>
134      <entry> Repairing input range adaptors and counted_iterator </entry>
135      <entry>
136        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2259r1.html">
137        P2259R1
138        </link>
139      </entry>
140      <entry align="center"> 12.1 </entry>
141      <entry />
142    </row>
143
144    <row>
145      <entry> Superior String Splitting </entry>
146      <entry>
147        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2210r2.html">
148        P2210R2
149        </link>
150      </entry>
151      <entry align="center"> 12.1 </entry>
152      <entry />
153    </row>
154
155    <row>
156      <entry> What is a <code>view</code>? </entry>
157      <entry>
158        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2415r2.html">
159        P2415R2
160        </link>
161      </entry>
162      <entry align="center"> 12.1 </entry>
163      <entry> <code>__cpp_lib_ranges &gt;= 202110L</code> </entry>
164    </row>
165
166    <row>
167      <entry> Fix istream_view </entry>
168      <entry>
169        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2432r1.pdf">
170        P2432R1
171        </link>
172      </entry>
173      <entry align="center"> 12.1 </entry>
174      <entry />
175    </row>
176
177    <row>
178      <?dbhtml bgcolor="#C8B0B0" ?>
179      <entry> <code>starts_with</code> and <code>ends_with</code> </entry>
180      <entry>
181        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1659r3.html">
182        P1659R3
183        </link>
184      </entry>
185      <entry align="center"> </entry>
186      <entry> <code>__cpp_lib_ranges_starts_ends_with &gt;= 202106L</code> </entry>
187    </row>
188
189    <row>
190      <?dbhtml bgcolor="#C8B0B0" ?>
191      <entry> <code>zip</code> </entry>
192      <entry>
193        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2321r2.html">
194        P2321R2
195        </link>
196      </entry>
197      <entry align="center"> </entry>
198      <entry> <code>__cpp_lib_ranges_zip &gt;= 202110L</code> </entry>
199    </row>
200
201    <row>
202      <entry namest="c1" nameend="c4" align="left">
203        <emphasis role="bold">Compile-time programming</emphasis>
204      </entry>
205    </row>
206
207    <row>
208      <entry> A proposal for a type trait to detect scoped enumerations </entry>
209      <entry>
210        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1048r1.pdf">
211        P1048R1
212        </link>
213      </entry>
214      <entry align="center"> 11.1 </entry>
215      <entry> <code>__cpp_lib_is_scoped_enum &gt;= 202011L</code> </entry>
216    </row>
217
218    <row>
219      <entry> std::to_underlying for enumerations </entry>
220      <entry>
221        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1682r3.html">
222        P1682R3
223        </link>
224      </entry>
225      <entry align="center"> 11.1 </entry>
226      <entry> <code>__cpp_lib_to_underlying &gt;= 202102L</code> </entry>
227    </row>
228
229    <row>
230      <entry> Missing constexpr in std::optional and std::variant </entry>
231      <entry>
232        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2231r1.html">
233        P2231R1
234        </link>
235      </entry>
236      <entry align="center">
237	<informaltable colsep="0" rowsep="0" rowheader="norowheader" frame="none"><tgroup cols="1"><tbody>
238        <row><entry> 11.3 (<code>optional</code>) </entry></row>
239        <row><entry> 12.1 (<code>variant</code>) </entry></row>
240        </tbody></tgroup></informaltable>
241      </entry>
242      <entry>
243	<informaltable colsep="0" rowsep="0" rowheader="norowheader" frame="none"><tgroup cols="1"><tbody>
244        <row><entry> <code>__cpp_lib_constexpr_optional &gt;= 202106L</code> </entry></row>
245        <row><entry> <code>__cpp_lib_variant &gt;= 202106L</code> </entry></row>
246        </tbody></tgroup></informaltable>
247      </entry>
248    </row>
249
250    <row>
251      <entry> Making <code>std::unique_ptr</code> constexpr </entry>
252      <entry>
253        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2273r3.pdf">
254        P2273R3
255        </link>
256      </entry>
257      <entry align="center"> 12.1 </entry>
258      <entry> <code>__cpp_lib_constexpr_memory &gt;= 202202L</code> </entry>
259    </row>
260
261    <row>
262      <entry> Making <code>std::type_info::operator==</code> constexpr </entry>
263      <entry>
264        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1328r1.html">
265        P1328R1
266        </link>
267      </entry>
268      <entry align="center"> 12.1 </entry>
269      <entry> <code>__cpp_lib_constexpr_typeinfo &gt;= 202106L</code> </entry>
270    </row>
271
272    <row>
273      <?dbhtml bgcolor="#C8B0B0" ?>
274      <entry> constexpr for <code>&lt;cmath&gt;</code> and <code>&lt;cstdlib&gt;</code> </entry>
275      <entry>
276        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf">
277        P0533R9
278        </link>
279      </entry>
280      <entry align="center"> </entry>
281      <entry> <code>__cpp_lib_constexpr_cmath &gt;= 202202L</code> </entry>
282    </row>
283
284    <row>
285      <?dbhtml bgcolor="#C8B0B0" ?>
286      <entry> Deprecate std::aligned_storage and std::aligned_union </entry>
287      <entry>
288        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1413r3.pdf">
289        P1413R3
290        </link>
291      </entry>
292      <entry align="center"> </entry>
293      <entry />
294    </row>
295
296    <row>
297      <?dbhtml bgcolor="#C8B0B0" ?>
298      <entry> A type trait to detect reference binding to temporary </entry>
299      <entry>
300        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2255r2.html">
301        P2255R2
302        </link>
303      </entry>
304      <entry align="center"> </entry>
305      <entry> <code>__cpp_lib_reference_from_temporary &gt;= 202202L</code> </entry>
306    </row>
307
308    <row>
309      <entry namest="c1" nameend="c4" align="left">
310        <emphasis role="bold">Strings and text</emphasis>
311      </entry>
312    </row>
313
314    <row>
315      <entry> string contains function </entry>
316      <entry>
317        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1679r3.html">
318        P1679R3
319        </link>
320      </entry>
321      <entry align="center"> 11.1 </entry>
322      <entry> <code>__cpp_lib_string_contains &gt;= 202011L</code> </entry>
323    </row>
324
325    <row>
326      <entry> Prohibit std::basic_string and std::basic_string_view construction from nullptr </entry>
327      <entry>
328        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2166r1.html">
329        P2166R1
330        </link>
331      </entry>
332      <entry align="center"> 12.1 </entry>
333      <entry />
334    </row>
335
336    <row>
337      <entry> basic_string::resize_and_overwrite </entry>
338      <entry>
339        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1072r10.html">
340        P1072R10
341        </link>
342      </entry>
343      <entry align="center"> 12.1 </entry>
344      <entry> <code>__cpp_lib_resize_and_overwrite &gt;= 202110L</code> </entry>
345    </row>
346
347    <row>
348      <entry> A strstream replacement using span&lt;charT&gt; as buffer </entry>
349      <entry>
350        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0448r4.pdf">
351        P0448R4
352        </link>
353      </entry>
354      <entry align="center"> 12.1 </entry>
355      <entry> <code>__cpp_lib_spanstream &gt;= 202106L</code> </entry>
356    </row>
357
358    <row>
359      <entry namest="c1" nameend="c4" align="left">
360        <emphasis role="bold">Containers</emphasis>
361      </entry>
362    </row>
363
364    <row>
365      <entry> Iterator pair constructors for stack and queue </entry>
366      <entry>
367        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1425r4.pdf">
368        P1425R4
369        </link>
370      </entry>
371      <entry align="center"> 12.1 </entry>
372      <entry> <code>__cpp_lib_adaptor_iterator_pair_constructor &gt;= 202106L</code> </entry>
373    </row>
374
375    <row>
376      <entry> Stop overconstraining allocators in container deduction guides </entry>
377      <entry>
378        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1518r2.html">
379        P1518R2
380        </link>
381      </entry>
382      <entry align="center"> 12.1 </entry>
383      <entry />
384    </row>
385
386    <row>
387      <?dbhtml bgcolor="#C8B0B0" ?>
388      <entry> Heterogeneous erasure overloads for associative containers </entry>
389      <entry>
390        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2077r3.html">
391        P2077R3
392        </link>
393      </entry>
394      <entry align="center"> </entry>
395      <entry> <code>__cpp_lib_associative_heterogeneous_erasure &gt;= 202110L</code> </entry>
396    </row>
397
398    <row>
399      <entry namest="c1" nameend="c4" align="left">
400        <emphasis role="bold">Miscellaneous</emphasis>
401      </entry>
402    </row>
403
404    <row>
405      <entry> Inheriting from <code>std::variant</code> </entry>
406      <entry>
407        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2162r2.html">
408        P2162R2
409        </link>
410      </entry>
411      <entry align="center"> 11.3 </entry>
412      <entry> <code>__cpp_lib_variant &gt;= 202102L</code> </entry>
413    </row>
414
415    <row>
416      <entry> Printing <code>volatile</code> Pointers </entry>
417      <entry>
418        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1147r1.html">
419        P1147R1
420        </link>
421      </entry>
422      <entry align="center"> 11.3 </entry>
423      <entry/>
424    </row>
425
426    <row>
427      <entry> A Proposal to add stacktrace library </entry>
428      <entry>
429        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0881r7.html">
430        P0881R7
431        </link>
432      </entry>
433      <entry align="center"> 12.1 </entry>
434      <entry> <code>__cpp_lib_stacktrace &gt;= 202011L</code> </entry>
435    </row>
436
437    <row>
438      <entry> Add a pmr alias for std::stacktrace </entry>
439      <entry>
440        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2301r1.html">
441        P2301R1
442        </link>
443      </entry>
444      <entry align="center"> 12.1 </entry>
445      <entry />
446    </row>
447
448    <row>
449      <entry> <code>std::expected</code> </entry>
450      <entry>
451        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html">
452        P0323R12
453        </link>
454      </entry>
455      <entry align="center"> 12.1 </entry>
456      <entry> <code>__cpp_lib_expected &gt;= 202202L</code> </entry>
457    </row>
458
459    <row>
460      <entry> Monadic operations for std::optional </entry>
461      <entry>
462        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0798r8.html">
463        P0798R8
464        </link>
465      </entry>
466      <entry align="center"> 12.1 </entry>
467      <entry> <code>__cpp_lib_optional &gt;= 202110L</code> </entry>
468    </row>
469
470    <row>
471      <entry> <code>move_only_function</code> </entry>
472      <entry>
473        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0288r9.html">
474        P0288R9
475        </link>
476      </entry>
477      <entry align="center"> 12.1 </entry>
478      <entry> <code>__cpp_lib_move_only_function &gt;= 202110L</code> </entry>
479    </row>
480
481    <row>
482      <entry> <code>invoke_r</code> </entry>
483      <entry>
484        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2136r3.html">
485        P2136R3
486        </link>
487      </entry>
488      <entry align="center"> 12.1 </entry>
489      <entry> <code>__cpp_lib_invoke_r &gt;= 202106L</code> </entry>
490    </row>
491
492    <row>
493      <entry> Byteswapping for fun&amp;&amp;nuf </entry>
494      <entry>
495        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1272r4.html">
496        P1272R4
497        </link>
498      </entry>
499      <entry align="center"> 12.1 </entry>
500      <entry> <code>__cpp_lib_byteswap &gt;= 202110L</code> </entry>
501    </row>
502
503    <row>
504      <entry> Function to mark unreachable code </entry>
505      <entry>
506        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0627r6.pdf">
507        P0627R6
508        </link>
509      </entry>
510      <entry align="center"> 12.1 </entry>
511      <entry> <code>__cpp_lib_unreachable &gt;= 202202L</code> </entry>
512    </row>
513
514    <row>
515      <entry> Add a conditional noexcept specification to std::exchange </entry>
516      <entry>
517        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2401r0.html">
518        P2401R0
519        </link>
520      </entry>
521      <entry align="center"> 12.1 </entry>
522      <entry />
523    </row>
524
525    <row>
526      <entry> Support C atomics in C++ </entry>
527      <entry>
528        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p0943r6.html">
529        P0943R6
530        </link>
531      </entry>
532      <entry align="center"> 12.1 </entry>
533      <entry> <code>__cpp_lib_stdatomic_h &gt;= 202011L</code> </entry>
534    </row>
535
536    <row>
537      <entry> Clarifying the status of the "C headers" </entry>
538      <entry>
539        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2340r1.html">
540        P2340R1
541        </link>
542      </entry>
543      <entry align="center"> Yes </entry>
544      <entry />
545    </row>
546
547    <row>
548      <entry> Relax Requirements for time_point::clock </entry>
549      <entry>
550        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2212r2.html">
551        P2212R2
552        </link>
553      </entry>
554      <entry align="center"> Yes </entry>
555      <entry />
556    </row>
557
558    <row>
559      <entry> Removing Garbage Collection Support </entry>
560      <entry>
561        <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2186r2.html">
562        P2186R2
563        </link>
564      </entry>
565      <entry align="center"> 12.1 </entry>
566      <entry />
567    </row>
568
569  </tbody>
570</tgroup>
571</table>
572
573</section>
574