|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4286" status="New"> |
| 5 | +<title>Some more feature-test macros for fully freestanding features are not marked freestanding</title> |
| 6 | +<section> |
| 7 | +<sref ref="[version.syn]"/><sref ref="[memory.syn]"/> |
| 8 | +</section> |
| 9 | +<submitter>Yihe Li</submitter> |
| 10 | +<date>17 Jun 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +LWG <iref ref="4189"/> (accepted in Hagenberg) added nearly the entire <tt><ranges></tt> header to freestanding. |
| 16 | +However, the only feature-test macro being added to freestanding is `__cpp_lib_ranges_cache_latest`, which seems weird, |
| 17 | +since `views::enumerate` is also added to freestanding following the blanket comment strategy, but its feature-test |
| 18 | +macro remains not in freestanding. In retrospective, since all range algorithms are in freestanding via |
| 19 | +<paper num="P2976"/>, all `__cpp_lib_ranges_*` FTMs (except `__cpp_lib_ranges_generate_random` since |
| 20 | +`ranges::generate_random` is not in freestanding) should probably be marked as freestanding. |
| 21 | +<p/> |
| 22 | +Furthermore, LWG <iref ref="4126"/> left out some other FTMs for fully freestanding features. They are also added |
| 23 | +in the following wording. |
| 24 | +<p/> |
| 25 | +A note about `is_sufficiently_aligned`: <paper num="P2897R7"/> does indicate in 5.7.6.1 that the function should be |
| 26 | +freestanding, but somehow the wording didn't say so. The following wording includes the function and its FTM anyway |
| 27 | +since hopefully this is just an omission when wording the paper. |
| 28 | +</p> |
| 29 | +</discussion> |
| 30 | + |
| 31 | +<resolution> |
| 32 | +<p> |
| 33 | +This wording is relative to <paper num="N5008"/>. |
| 34 | +</p> |
| 35 | + |
| 36 | +<ol> |
| 37 | +<li><p>Modify <sref ref="[version.syn]"/>, header <tt><version></tt> synopsis, as indicated:</p> |
| 38 | + |
| 39 | +<blockquote> |
| 40 | +<pre> |
| 41 | +[…] |
| 42 | +#define __cpp_lib_aligned_accessor 202411L <i>// <ins>freestanding,</ins> also in <mdspan></i> |
| 43 | +[…] |
| 44 | +#define __cpp_lib_array_constexpr 201811L <i>// <ins>freestanding,</ins> also in <iterator>, <array></i> |
| 45 | +[…] |
| 46 | +#define __cpp_lib_clamp 201603L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 47 | +[…] |
| 48 | +#define __cpp_lib_constexpr_numeric 201911L <i>// <ins>freestanding,</ins> also in <numeric></i> |
| 49 | +[…] |
| 50 | +#define __cpp_lib_function_ref 202306L <i>// <ins>freestanding,</ins> also in <functional></i> |
| 51 | +#define __cpp_lib_gcd_lcm 201606L <i>// <ins>freestanding,</ins> also in <numeric></i> |
| 52 | +[…] |
| 53 | +#define __cpp_lib_integer_comparison_functions 202002L <i>// <ins>freestanding,</ins> also in <utility></i> |
| 54 | +[…] |
| 55 | +#define __cpp_lib_is_sufficiently_aligned 202411L <i>// <ins>freestanding,</ins> also in <memory></i> |
| 56 | +[…] |
| 57 | +#define __cpp_lib_ranges_contains 202207L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 58 | +#define __cpp_lib_ranges_enumerate 202302L <i>// <ins>freestanding,</ins> also in <ranges></i> |
| 59 | +#define __cpp_lib_ranges_find_last 202207L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 60 | +#define __cpp_lib_ranges_fold 202207L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 61 | +[…] |
| 62 | +#define __cpp_lib_ranges_iota 202202L <i>// <ins>freestanding,</ins> also in <numeric></i> |
| 63 | +[…] |
| 64 | +#define __cpp_lib_ranges_reserve_hint 202502L <i>// <ins>freestanding,</ins> also in <ranges></i> |
| 65 | +[…] |
| 66 | +#define __cpp_lib_ranges_starts_ends_with 202106L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 67 | +[…] |
| 68 | +#define __cpp_lib_robust_nonmodifying_seq_ops 201304L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 69 | +#define __cpp_lib_sample 201603L <i>// <ins>freestanding,</ins> also in <algorithm></i> |
| 70 | +#define __cpp_lib_saturation_arithmetic 202311L <i>// <ins>freestanding,</ins> also in <numeric></i> |
| 71 | +[…] |
| 72 | +</pre> |
| 73 | +</blockquote> |
| 74 | +</li> |
| 75 | + |
| 76 | +<li><p>Modify <sref ref="[memory.syn]"/>, header <tt><memory></tt> synopsis, as indicated:</p> |
| 77 | + |
| 78 | +<blockquote> |
| 79 | +<pre> |
| 80 | +[…] |
| 81 | +template<size_t Alignment, class T> |
| 82 | + bool is_sufficiently_aligned(T* ptr); <ins><i>// freestanding</i></ins> |
| 83 | +[…] |
| 84 | +</pre> |
| 85 | +</blockquote> |
| 86 | +</li> |
| 87 | + |
| 88 | +</ol> |
| 89 | +</resolution> |
| 90 | + |
| 91 | +</issue> |
0 commit comments