|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4480" status="New"> |
| 5 | +<title><tt><stdatomic.h></tt> should provide `ATOMIC_CHAR8_T_LOCK_FREE`</title> |
| 6 | +<section><sref ref="[stdatomic.h.syn]"/></section> |
| 7 | +<submitter>Jiang An</submitter> |
| 8 | +<date>21 Nov 2025</date> |
| 9 | +<priority>99</priority> |
| 10 | + |
| 11 | +<discussion> |
| 12 | +<p> |
| 13 | +Currently, <tt><stdatomic.h></tt> is specified to provide `atomic_char8_t` but not its |
| 14 | +corresponding `ATOMIC_CHAR8_T_LOCK_FREE` macro, which is self-inconsistent. Also, given |
| 15 | +<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2653.htm">WG14 N2653</a> added |
| 16 | +`ATOMIC_CHAR8_T_LOCK_FREE` to C's <tt><stdatomic.h></tt> in C23, perhaps C++ should do |
| 17 | +the same thing in the spirit of <paper num="P3348R4"/>. |
| 18 | +</p> |
| 19 | +</discussion> |
| 20 | + |
| 21 | +<resolution> |
| 22 | +<p> |
| 23 | +This wording is relative to <paper num="N5014"/>. |
| 24 | +</p> |
| 25 | + |
| 26 | +<ol> |
| 27 | +<li><p>Modify <sref ref="[stdatomic.h.syn]"/>, header <tt><stdatomic.h></tt> synopsis, as indicated:</p> |
| 28 | + |
| 29 | +<blockquote> |
| 30 | +<pre> |
| 31 | +template<class T> |
| 32 | + using <i>std-atomic</i> = std::atomic<T>; <i>// exposition only</i> |
| 33 | + |
| 34 | +#define _Atomic(T) <i>std-atomic</i><T> |
| 35 | + |
| 36 | +#define ATOMIC_BOOL_LOCK_FREE <i>see below</i> |
| 37 | +#define ATOMIC_CHAR_LOCK_FREE <i>see below</i> |
| 38 | +<ins>#define ATOMIC_CHAR8_T_LOCK_FREE <i>see below</i></ins> |
| 39 | +#define ATOMIC_CHAR16_T_LOCK_FREE <i>see below</i> |
| 40 | +#define ATOMIC_CHAR32_T_LOCK_FREE <i>see below</i> |
| 41 | +#define ATOMIC_WCHAR_T_LOCK_FREE <i>see below</i> |
| 42 | +#define ATOMIC_SHORT_LOCK_FREE <i>see below</i> |
| 43 | +#define ATOMIC_INT_LOCK_FREE <i>see below</i> |
| 44 | +#define ATOMIC_LONG_LOCK_FREE <i>see below</i> |
| 45 | +#define ATOMIC_LLONG_LOCK_FREE <i>see below</i> |
| 46 | +#define ATOMIC_POINTER_LOCK_FREE <i>see below</i> |
| 47 | + |
| 48 | +[…] |
| 49 | +</pre> |
| 50 | +</blockquote> |
| 51 | +</li> |
| 52 | +</ol> |
| 53 | + |
| 54 | +</resolution> |
| 55 | + |
| 56 | +</issue> |
0 commit comments