<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>P3309R1: constexpr atomic&lt;T&gt; and atomic_ref&lt;T&gt;</title>
<link rel="stylesheet" href="data:text/css;base64,QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgewoJOnJvb3QgewoJCS0tdGV4dC1jb2xvcjogI0JCQjsKCQktLWZvdW5kLWhpZ2hsaWdodDogYmx1ZTsKCQktLWZvdW5kLXRleHQtY29sb3I6IHdoaXRlOwoJCS0tbWFpbi1iYWNrZ3JvdW5kOiAzMiwzMiwzMjsKCQktLWhlYWRlci1jb2xvcjogd2hpdGU7CgkJLS1ib3gtc2hhZG93LWNvbG9yOiByZ2JhKDAsMCwwLDAuNSk7CgkJLS1uYXYtYmFja2dyb3VuZC1jb2xvcjogIzEwMTAxMDsKCQktLWNvZGUtZm9yZWdyb3VuZC1jb2xvcjogd2hpdGU7CgkJLS1jb2RlLWluZm8tY29sb3I6IHJnYmEoMjU1LDI1NSwyNTUsMC4xKTsKCQktLWNvZGUtYmFja2dyb3VuZC1jb2xvcjogdmFyKC0tbmF2LWJhY2tncm91bmQtY29sb3IpOwoJCS0tbGluay1jb2xvcjogIzhlZjNmZjsKCQktLXZpc2l0ZWQtbGluay1jb2xvcjogI2YwZmY4OTsKCQktLWhvdmVyLWxpbmstY29sb3I6ICNiM2Y3ZmY7CgkJLS1ob3Zlci12aXNpdGVkLWxpbmstY29sb3I6ICNjOGZmYjM7CgkJLS1saW5lLWNvbG9yOiAyNTUsMjU1LDI1NTsKCQktLWhlYWRlci1iYWNrZ3JvdW5kOiAwLDAsMDsKCQktLXF1b3RlLWxlZnQtY29sb3I6IHJnYmEoMjU1LDI1NSwyNTUsMC41KTsKCX0KCTo6c2VsZWN0aW9uIHsKCSAgY29sb3I6IGJsYWNrOwoJICBiYWNrZ3JvdW5kOiBsaWdodHllbGxvdzsKCX0KCQp9CgpAbWVkaWEgKHByZWZ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gLmNvbW1lbnQgewogICAgICAgIGNvbG9yOiAjMzVkYTAwOwogICAgfQoKICAgIC53b3JkaW5nIC5mb290bm90ZSAuY29tbWVudCB7CiAgICAgICAgY29sb3I6ICMzNWRhMDA7CiAgICB9CgogICAgLndvcmRpbmcgLmV4YW1wbGUgLmNvbW1lbnQgewogICAgICAgIGNvbG9yOiAjMzVkYTAwOwogICAgfQoKICAgIC53b3JkaW5nIC5ub3RlIC5jb21tZW50IHsKICAgICAgICBjb2xvcjogIzM1ZGEwMDsKICAgIH0KCiAgICAud29yZGluZyBzcGFuLmtleXdvcmQgewogICAgICAgIGNvbG9yOiAjMTJjYWJlOwogICAgfQoKICAgIC53b3JkaW5nIHNwYW4ucGFyZW50aGVzaXMgewogICAgICAgIGNvbG9yOiAjZmYxNTE1OwogICAgfQoKICAgIC53b3JkaW5nIHNwYW4uY3VybHlicmFja2V0IHsKICAgICAgICBjb2xvcjogI2ZmMTUxNTsKICAgIH0KCiAgICAud29yZGluZyBzcGFuLnNxdWFyZWJyYWNrZXQgewogICAgICAgIGNvbG9yOiAjZmYxNTE1OwogICAgfQoKICAgIC53b3JkaW5nIHNwYW4ubGl0ZXJhbCB7CiAgICAgICAgY29sb3I6ICNkZmE4Mzc7CiAgICB9CgogICAgLndvcmRpbmcgc3Bhbi5saXRlcmFsdGVybWluYWwgewogICAgICAgIGNvbG9yOiAjZGZhODM3OwogICAgfQoKICAgIC53b3JkaW5nIHNwYW4ub3BlcmF0b3IgewogICAgICAgIGNvbG9yOiAjYmFhNmI5OwogICAgfQoKICAgIC53b3JkaW5nIHNwYW4uYW5nbGVicmFja2V0IHsKICAgICAgICBjb2xvcjogI2JhYTZiOTsKICAgIH0KCiAgICAud29yZGluZyBzcGFuLnByZXByb2Nlc3NvcmRpcmVjdGl2ZSB7CiAgICAgICAgY29sb3I6ICNiMjdjNTg7CiAgICB9CgogICAgLndvcmRpbmcgdGFibGUgewogICAgICAgIGJvcmRlci1jb2xvcjogI2QwZDBkMDsKICAgIH0KCiAgICAud29yZGluZyB0ZC5ib3JkZXIgewogICAgICAgIGJvcmRlci1jb2xvcjogI2QwZDBkMDsKICAgIH0KCiAgICAud29yZGluZyB0ZC5ib3JkZXIgewogICAgICAgIGJvcmRlci1sZWZ0LWNvbG9yOiAjZDBkMGQwOwogICAgfQoKICAgIC53b3JkaW5nIHRyLnJvd3NlcCwgdGQuY2xpbmUgewogICAgICAgIGJvcmRlci10b3AtY29sb3I6ICNkMGQwZDA7CiAgICB9CgogICAgLndvcmRpbmcgdHIuY2Fwc2VwIHsKICAgICAgICBib3JkZXItdG9wLWNvbG9yOiAjZDBkMGQwOwogICAgfQoKICAgIC53b3JkaW5nIHRoIHsKICAgICAgICBib3JkZXItYm90dG9tLWNvbG9yOiAjZDBkMGQwOwogICAgfQoKICAgIC53b3JkaW5nIC5mb290bm90ZVNlcGFyYXRvciB7CiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogI2QwZDBkMDsKICAgIH0KCiAgICAud29yZGluZyB0ZXh0IHsKICAgICAgICBmaWxsOiAjZDBkMGQwOwogICAgfQoKICAgIC53b3JkaW5nIHBhdGggewogICAgICAgIHN0cm9rZTogI2QwZDBkMDsKICAgIH0KCiAgICAud29yZGluZyBwb2x5Z29uIHsKICAgICAgICBzdHJva2U6ICNkMGQwZDA7CiAgICAgICAgZmlsbDogI2QwZDBkMDsKICAgIH0KCiAgICAud29yZGluZyBlbGxpcHNlIHsKICAgICAgICBzdHJva2U6ICNkMGQwZDA7CiAgICB9Cgp9Cgoud29yZGluZyAubWp4LWNodG1sIHsKICAgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKICAgIGxpbmUtaGVpZ2h0OiAwOwogICAgdGV4dC1pbmRlbnQ6IDA7CiAgICB0ZXh0LWFsaWduOiBsZWZ0OwogICAgdGV4dC10cmFuc2Zvcm06IG5vbmU7CiAgICBmb250LXN0eWxlOiBub3JtYWw7CiAgICBmb250LXdlaWdodDogbm9ybWFsOwogICAgZm9udC1zaXplOiA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LWZhbWlseTogJ05vdG8gU2Fucyc7IGZvbnQtc2l6ZTogOXB0OyB9Ci53b3JkaW5nIGRpdi5leGFtcGxlIC50ZXh0c2YgeyBmb250LWZhbWlseTogJ05vdG8gU2Fucyc7IGZvbnQtc2l6ZTogOXB0OyB9Cgoud29yZGluZyBkaXYubm90ZSAubWF0aCB7IGZvbnQtc2l6ZTogOXB0OyB9Ci53b3JkaW5nIGRpdi5leGFtcGxlIC5tYXRoIHsgZm9udC1zaXplOiA5cHQ7IH0KCi53b3JkaW5nIGRpdi5leGFtcGxlIHsgZGlzcGxheTogbm9uZTsgfQoud29yZGluZyBkaXYubm90ZSB7IGRpc3BsYXk6IG5vbmU7IH0KCi53b3JkaW5nIGEuZm9vdG5vdGVudW0geyBkaXNwbGF5OiBub25lOyB9Ci53b3JkaW5nIGRpdi5mb290bm90ZSB7IGRpc3BsYXk6IG5vbmU7IH0KLndvcmRpbmcgZGl2LmZvb3Rub3RlU2VwYXJhdG9yIHsgZGlzcGxheTogbm9uZTsgfQoud29yZGluZyAuZm9vdG5vdGVyZWYgeyBkaXNwbGF5OiBub25lOyB9Cgoud29yZGluZyBkaXYubm9uTm9ybWF0aXZlT25seSB7IGRpc3BsYXk6IG5vbmU7IH0KCg==">
<link href="https://fonts.googleapis.com/css?family=Noto+Serif" rel='stylesheet'>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans" rel='stylesheet'>
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+Mono" rel='stylesheet'>
<script src="data:text/javascript;base64,LyohCiAgSGlnaGxpZ2h0LmpzIHYxMS45LjAgKGdpdDogYjdlYzRiZmFmYykKICAoYykgMjAwNi0yMDI0IHVuZGVmaW5lZCBhbmQgb3RoZXIgY29udHJpYnV0b3JzCiAgTGljZW5zZTogQlNELTMtQ2xhdXNlCiAqLwp2YXIgaGxqcz1mdW5jdGlvbigpeyJ1c2Ugc3RyaWN0IjtmdW5jdGlvbiBlKHQpewpyZXR1cm4gdCBpbnN0YW5jZW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lnaGxpZ2h0ZWQgbm9kZSBzdGFjaywgdGhlbiByZW5kZXIgdGhlIG9yaWdpbmFsIHRhZyBhbG9uZwogICAgICAgIHdpdGggYWxsIHRoZSBmb2xsb3dpbmcgb3JpZ2luYWwgdGFncyBhdCB0aGUgc2FtZSBvZmZzZXQgYW5kIHRoZW4KICAgICAgICByZW9wZW4gYWxsIHRoZSB0YWdzIG9uIHRoZSBoaWdobGlnaHRlZCBzdGFjay4KICAgICAgICAqLwogICAgICAgIG5vZGVTdGFjay5yZXZlcnNlKCkuZm9yRWFjaChjbG9zZSk7CiAgICAgICAgZG8gewogICAgICAgICAgcmVuZGVyKHN0cmVhbS5zcGxpY2UoMCwgMSlbMF0pOwogICAgICAgICAgc3RyZWFtID0gc2VsZWN0U3RyZWFtKCk7CiAgICAgICAgfSB3aGlsZSAoc3RyZWFtID09PSBvcmlnaW5hbCAmJiBzdHJlYW0ubGVuZ3RoICYmIHN0cmVhbVswXS5vZmZzZXQgPT09IHByb2Nlc3NlZCk7CiAgICAgICAgbm9kZVN0YWNrLnJldmVyc2UoKS5mb3JFYWNoKG9wZW4pOwogICAgICB9IGVsc2UgewogICAgICAgIGlmIChzdHJlYW1bMF0uZXZlbnQgPT09ICdzdGFydCcpIHsKICAgICAgICAgIG5vZGVTdGFjay5wdXNoKHN0cmVhbVswXS5ub2RlKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgbm9kZVN0YWNrLnBvcCgpOwogICAgICAgIH0KICAgICAgICByZW5kZXIoc3RyZWFtLnNwbGljZSgwLCAxKVswXSk7CiAgICAgIH0KICAgIH0KICAgIHJldHVybiByZXN1bHQgKyBlc2NhcGVIVE1MKHZhbHVlLnN1YnN0cihwcm9jZXNzZWQpKTsKICB9CgogIHJldHVybiBtZXJnZUhUTUxQbHVnaW47Cgp9KCkpOw=="></script>
</head>
<body><div>
<nav><div><div>
<h1 class="hide-on-wide name-of-paper">constexpr atomic&lt;T&gt; and atomic_ref&lt;T&gt;</h1>
<div class="paper-info">
	<div><span class="key">Number:</span> P3309R1</div>
	<div><span class="key">Date:</span> <time>2024-06-24</time></div>
	<div><span class="key">Audience:</span> LEWG</div>
	<div><span class="key">Reply-to:</span> <a href="mailto:cpp@hanicka.net">Hana Dusíková</a></div>
</div>

<h2 id="table-of-contents"><a href="#table-of-contents">Table of contents</a></h2>
<ul>
	<li><a href="#introduction">Introduction and motivation</a></li>
	<li><a href="#changes">Changes</a></li>
	<li><a href="#previous-polls">Previous polls</a></li>
	<li><a href="#intention">Intention for wording changes</a>
		<ul>
			<li><a href="#question-answered-by-sg1">Question answered by SG1</a></li>
			<li><a href="#questions-for-lewg">Question for LEWG</a></li>
		</ul>
	</li>
	<li><a href="#example">Example</a></li>
	<li><a href="#wording">Proposed changes to wording</a></li>
		<ul>
			<li><a href="#feature-test-macro">Feature test macro</a></li>
		</ul>
	<li><a href="#implementation-experience">Implementation experience</a></li>
	<li><a href="#impact-on-existing-code">Impact on existing code</a></li>
</ul>
</div></div></nav>
<article>
<div><div>
	<h1 class="hide-on-narrow name-of-paper">constexpr atomic&lt;T&gt; and atomic_ref&lt;T&gt;</h1>
	
	<h2 id="introduction"><a href="#introduction">Introduction and motivation</a></h2>
	<p>This paper proposes marking most of <code>atomic&lt;T&gt;</code> methods and associated functions <code>constexpr</code> to allow usage of atomic code without changes in a constexpr and consteval code.</p>
	<p>Proposed changes will allow implementing other types (<code>std::shared_ptr&lt;T&gt;</code>, persistent data structures with atomic pointers) and algorithms (thread safe data-processing, like scanning data with atomic counter) with just sprinkling <code>constexpr</code> to their specification.</p>
	
	<h2 id="changes"><a href="#Changes">Changes</a></h2>
	<ul>
		<li><a href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r0.html">R0</a>&#x2005;→&#x2005;R1: Make <code>wait</code> and <code>notify</code> functions as requested by SG1. Wording changed accordingly. Updaded link to implementation on Compiler Explorer.</li>
	</ul>
	<h2 id="previous-polls"><a href="#previous-polls">Previous polls</a></h2>
	<cite>SG1: Forward P3309 to LEWG with the following notes:

	<ul>
		<li>Add constexpr to the wait and notify functions in the next revision of P3309</li></li>
		<li><code>atomic&lt;shared_ptr&gt;</code> should be supported in constexpr whenever <code>shared_ptr</code> is supported in constexpr (whichever paper lands second should have this change)</li>
		<li><code>is_lock_free()</code> should not be made constexpr</li>
	</ul></cite>
	<table class="poll">
		<tr><th>SF</th><th>F</th><th>N</th><th>A</th><th>SA</th></tr>
		<tr><td>2</td><td>10</td><td>4</td><td>0</td><td>0</td></tr>
	</table>
	
	<h2 id="intention">Intention for wording changes</h2>
	<p>Mark all functions in [<a href="http://eel.is/c++draft/atomics#types.generic.general">atomics</a>] constexpr excluding all <code>volatile</code> overloads. As all these can be implemented in constant expression evaluator or using <code>if consteval</code>:</p>
	<pre class="language-cpp"><code>template&lt;class T&gt;
constexpr T atomic_fetch_add(atomic&lt;T&gt;* target, typename atomic&lt;T&gt;::difference_type diff) noexcept {
	if consteval {
		const auto previous = target-&gt;value;
		target-&gt;value += diff;
		return previous;
	} else {
		return __c11_atomic_fetch_add(&amp;target-&gt;value, diff);
	}
}</code></pre>
	<p>Synchronization functions and helpers can be implemented as no-ops (<code>std::kill_dependency</code>, <code>std::atomic_thread_fence</code>). Memory order parameters should be just ignored as <code>constant evaluated</code> code doesn't have multiple threads.</p>
	<p>Alternative implementation strategy is to allow atomic builtins to work in constant evaluator.</p>
	<h3 id="question-answered-by-sg1">Question answered by SG1</h3>
	<ul>
		<li>Should we make <code>is_lock_free</code> functions also constexpr? No, keep it non-constexpr as it can be different on running environment.</li>
	</ul>
	<h3 id="questions-for-lewg">Question for LEWG</h3>
	<ul>
		<li>Should we make <code>atomic&lt;shared_ptr&lt;T&gt;&gt;</code> and <code>atomic&lt;weak_ptr&lt;T&gt;&gt;</code> constexpr? (paper's wording contains this change)
			<p>There is associated paper <a href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3037r1.pdf">P3037R1</a> making <code>shared_ptr&lt;T&gt;</code> constexpr.</p>
		</li>
	</ul>
<h2 id="example"><a href="#example">Example</a></h2>
<p>This example shows how you can easily reuse code between runtime and constant evaluated code without duplication. Without this paper you need to duplicate multiple functions.</p>
<pre class="language-cpp"><code>constexpr bool process_first_unprocessed(std::atomic&lt;size_t&gt; & counter, std::span&lt;cell&gt; subject) {
	<span class="before">// BEFORE: compile-time error when you try to evaluate this inside constant evaluated code</span>
	<span class="after">// AFTER: work sequentialy in constant-evaluated code</span>
	const size_t current = counter.fetch_add(1); 
	
	if (current &gt;= subject.size()) {
		return false;
	}
	
	process(subject[current]);
	return true;
}

constexpr void process_all(std::span&lt;cell&gt; subject, unsigned thread_count = 1) {
	<span class="before">// BEFORE: calling following function in constant evaluated code will always fail with any number of requested threads</span>
	<span class="after">// AFTER: calling it with argument thread_count == 1 will succeed in constant evaluated code</span>
	std::atomic&lt;size_t&gt; counter{0};
	auto threads = std::vector&lt;std::jthread&gt;{};
	
	assert(thread_count &gt;= 1);
	
	for (unsigned i = 1; i &lt; thread_count; ++i) {
		threads.emplace_back([&]{
			while (process_first_unprocessed(counter, subject));
		});
	}
	
	while (process_first_unprocessed(counter, subject));
}</code></pre>
<a href="https://compiler-explorer.com/z/o1Y3oz8ra">link to compiler-explorer.com</a>
<h2 id="wording"><a href="#wording">Proposed changes to wording</a></h2>
<div class="wording">
<h1><a class="secnum" style="min-width:50pt">33</a> Concurrency support library <a class="abbr_ref" href="./#thread">[thread]</a></h1>
<h2><a class="secnum" style="min-width:65pt">33.5</a> Atomic operations <a class="abbr_ref">[atomics]</a></h2>
<div id="general" class="section"><h3><a class="secnum" href="#general" style="min-width:80pt">33.5.1</a> General <a class="abbr_ref" href="atomics.general">[atomics.general]</a></h3><div class="para" id="general-1"><div class="marginalizedparent"><a class="marginalized" href="#general-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2088">#</a></div><div class="texpara"><div id="general-1.sentence-1" class="sentence">Subclause [atomics] describes components for fine-grained atomic access<a class="hidden_link" href="#general-1.sentence-1">.</a></div> <div id="general-1.sentence-2" class="sentence">This access is provided via operations on atomic objects<a class="hidden_link" href="#general-1.sentence-2">.</a></div></div></div></div>
<div id="syn" class="section"><h3><a class="secnum" href="#syn" style="min-width:80pt">33.5.2</a> Header <span class="texttt">&lt;atomic&gt;</span> synopsis <a class="abbr_ref" href="atomics.syn">[atomics.syn]</a></h3><div class="texpara"><span id="header:<atomic>"><div class="marginalizedparent"><a class="itemDeclLink" href="#header:%3catomic%3e">🔗</a></div><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="comment">// <a href="#order" title="33.5.4 Order and consistency">[atomics.<span class="shy"></span>order]</a>, order and consistency</span>
  <span class="keyword">enum</span> <span class="keyword">class</span> memory_order <span class="operator">:</span> <i><span class="texttt">unspecified</span></i>;                                            <span class="comment">// freestanding</span>
  <span class="keyword">inline</span> <span class="keyword">constexpr</span> memory_order memory_order_relaxed <span class="operator">=</span> memory_order<span class="operator">::</span>relaxed;       <span class="comment">// freestanding</span>
  <span class="keyword">inline</span> <span class="keyword">constexpr</span> memory_order memory_order_consume <span class="operator">=</span> memory_order<span class="operator">::</span>consume;       <span class="comment">// freestanding</span>
  <span class="keyword">inline</span> <span class="keyword">constexpr</span> memory_order memory_order_acquire <span class="operator">=</span> memory_order<span class="operator">::</span>acquire;       <span class="comment">// freestanding</span>
  <span class="keyword">inline</span> <span class="keyword">constexpr</span> memory_order memory_order_release <span class="operator">=</span> memory_order<span class="operator">::</span>release;       <span class="comment">// freestanding</span>
  <span class="keyword">inline</span> <span class="keyword">constexpr</span> memory_order memory_order_acq_rel <span class="operator">=</span> memory_order<span class="operator">::</span>acq_rel;       <span class="comment">// freestanding</span>
  <span class="keyword">inline</span> <span class="keyword">constexpr</span> memory_order memory_order_seq_cst <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst;       <span class="comment">// freestanding</span>

  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T kill_dependency<span class="parenthesis">(</span>T y<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                                     <span class="comment">// freestanding</span>
<span class="curlybracket">}</span>

<span class="comment">// <a href="#lockfree" title="33.5.5 Lock-free property">[atomics.<span class="shy"></span>lockfree]</a>, lock-free property</span>
<span class="preprocessordirective">#define</span> ATOMIC_BOOL_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                           <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                           <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR8_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                        <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR16_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                       <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR32_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                       <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_WCHAR_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                        <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_SHORT_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                          <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_INT_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                            <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_LONG_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                           <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_LLONG_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                          <span class="comment">// freestanding</span>
<span class="preprocessordirective">#define</span> ATOMIC_POINTER_LOCK_FREE <i><span class="texttt">unspecified</span></i>                                        <span class="comment">// freestanding</span>

<span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="comment">// <a href="#ref.generic" title="33.5.7 Class template atomic_­ref">[atomics.<span class="shy"></span>ref.<span class="shy"></span>generic]</a>, class template <span class="tcode_in_codeblock">atomic_<span class="shy"></span>ref</span></span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic_ref;                                              <span class="comment">// freestanding</span>
  <span class="comment">// <a href="#ref.pointer" title="33.5.7.5 Partial specialization for pointers">[atomics.<span class="shy"></span>ref.<span class="shy"></span>pointer]</a>, partial specialization for pointers</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic_ref<span class="anglebracket">&lt;</span>T<span class="operator">*</span><span class="anglebracket">&gt;</span>;                                          <span class="comment">// freestanding</span>

  <span class="comment">// <a href="#types.generic" title="33.5.8 Class template atomic">[atomics.<span class="shy"></span>types.<span class="shy"></span>generic]</a>, class template <span class="tcode_in_codeblock">atomic</span></span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic;                                                  <span class="comment">// freestanding</span>
  <span class="comment">// <a href="#types.pointer" title="33.5.8.5 Partial specialization for pointers">[atomics.<span class="shy"></span>types.<span class="shy"></span>pointer]</a>, partial specialization for pointers</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic<span class="anglebracket">&lt;</span>T<span class="operator">*</span><span class="anglebracket">&gt;</span>;                                              <span class="comment">// freestanding</span>

  <span class="comment">// <a href="#nonmembers" title="33.5.9 Non-member functions">[atomics.<span class="shy"></span>nonmembers]</a>, non-member functions</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">bool</span> atomic_is_lock_free<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                   <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">bool</span> atomic_is_lock_free<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                            <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">void</span> atomic_store<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                          <span class="comment">// freestanding</span>
                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">void</span> atomic_store<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;         <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">void</span> atomic_store_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                 <span class="comment">// freestanding</span>
                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                               memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">void</span> atomic_store_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,          <span class="comment">// freestanding</span>
                               memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_load<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_load<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                                       <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_load_explicit<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;       <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_load_explicit<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_exchange<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                          <span class="comment">// freestanding</span>
                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_exchange<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;         <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_exchange_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                 <span class="comment">// freestanding</span>
                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                               memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_exchange_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,          <span class="comment">// freestanding</span>
                               memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">bool</span> atomic_compare_exchange_weak<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                          <span class="comment">// freestanding</span>
                                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">bool</span> atomic_compare_exchange_weak<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                   <span class="comment">// freestanding</span>
                                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">bool</span> atomic_compare_exchange_strong<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                        <span class="comment">// freestanding</span>
                                        <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                        <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">bool</span> atomic_compare_exchange_strong<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                 <span class="comment">// freestanding</span>
                                        <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                        <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">bool</span> atomic_compare_exchange_weak_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                 <span class="comment">// freestanding</span>
                                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">bool</span> atomic_compare_exchange_weak_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                          <span class="comment">// freestanding</span>
                                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">bool</span> atomic_compare_exchange_strong_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,               <span class="comment">// freestanding</span>
                                                 <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                                 <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">bool</span> atomic_compare_exchange_strong_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                        <span class="comment">// freestanding</span>
                                                 <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="operator">*</span>,
                                                 <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_add<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_add<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;   <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_add_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_add_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type,    <span class="comment">// freestanding</span>
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_sub<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_sub<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;   <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_sub_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_sub_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>difference_type,    <span class="comment">// freestanding</span>
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_and<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_and<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;        <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_and_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_and_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,         <span class="comment">// freestanding</span>
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_or<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                          <span class="comment">// freestanding</span>
                      <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_or<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;         <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_or_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                 <span class="comment">// freestanding</span>
                               <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                               memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_or_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,          <span class="comment">// freestanding</span>
                               memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_xor<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_xor<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;        <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_xor_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_xor_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,         <span class="comment">// freestanding</span>
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_max<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_max<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                                  <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_max_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_max_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_min<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_min<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                                  <span class="comment">// freestanding</span>
                       <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    T atomic_fetch_min_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span>T atomic_fetch_min_explicit<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                         <span class="comment">// freestanding</span>
                                <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                                memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">void</span> atomic_wait<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                                     <span class="comment">// freestanding</span>
	             <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">void</span> atomic_wait<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;    <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">void</span> atomic_wait_explicit<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>,                            <span class="comment">// freestanding</span>
                              <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,
                              memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">void</span> atomic_wait_explicit<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span>, <span class="keyword">typename</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">::</span>value_type,     <span class="comment">// freestanding</span>
                              memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">void</span> atomic_notify_one<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                           <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">void</span> atomic_notify_one<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="keyword">void</span> atomic_notify_all<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                           <span class="comment">// freestanding</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
    <span class="added">constexpr </span><span class="keyword">void</span> atomic_notify_all<span class="parenthesis">(</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                                    <span class="comment">// freestanding</span>

  <span class="comment">// <a href="#alias" title="33.5.3 Type aliases">[atomics.<span class="shy"></span>alias]</a>, type aliases</span>
  <span class="keyword">using</span> atomic_bool           <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">bool</span><span class="anglebracket">&gt;</span>;                                       <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_char           <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">char</span><span class="anglebracket">&gt;</span>;                                       <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_schar          <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">signed</span> <span class="keyword">char</span><span class="anglebracket">&gt;</span>;                                <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uchar          <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">char</span><span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_short          <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">short</span><span class="anglebracket">&gt;</span>;                                      <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_ushort         <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">short</span><span class="anglebracket">&gt;</span>;                             <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int            <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">int</span><span class="anglebracket">&gt;</span>;                                        <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint           <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">int</span><span class="anglebracket">&gt;</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_long           <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">long</span><span class="anglebracket">&gt;</span>;                                       <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_ulong          <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">long</span><span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_llong          <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">long</span> <span class="keyword">long</span><span class="anglebracket">&gt;</span>;                                  <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_ullong         <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span><span class="anglebracket">&gt;</span>;                         <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_char8_t        <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">char8_t</span><span class="anglebracket">&gt;</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_char16_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">char16_t</span><span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_char32_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">char32_t</span><span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_wchar_t        <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span><span class="keyword">wchar_t</span><span class="anglebracket">&gt;</span>;                                    <span class="comment">// freestanding</span>

  <span class="keyword">using</span> atomic_int8_t         <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int8_t<span class="anglebracket">&gt;</span>;                                     <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint8_t        <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint8_t<span class="anglebracket">&gt;</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int16_t        <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int16_t<span class="anglebracket">&gt;</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint16_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint16_t<span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int32_t        <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int32_t<span class="anglebracket">&gt;</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint32_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint32_t<span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int64_t        <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int64_t<span class="anglebracket">&gt;</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint64_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint64_t<span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>

  <span class="keyword">using</span> atomic_int_least8_t   <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_least8_t<span class="anglebracket">&gt;</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_least8_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_least8_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int_least16_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_least16_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_least16_t <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_least16_t<span class="anglebracket">&gt;</span>;                             <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int_least32_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_least32_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_least32_t <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_least32_t<span class="anglebracket">&gt;</span>;                             <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int_least64_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_least64_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_least64_t <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_least64_t<span class="anglebracket">&gt;</span>;                             <span class="comment">// freestanding</span>

  <span class="keyword">using</span> atomic_int_fast8_t    <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_fast8_t<span class="anglebracket">&gt;</span>;                                <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_fast8_t   <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_fast8_t<span class="anglebracket">&gt;</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int_fast16_t   <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_fast16_t<span class="anglebracket">&gt;</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_fast16_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_fast16_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int_fast32_t   <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_fast32_t<span class="anglebracket">&gt;</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_fast32_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_fast32_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_int_fast64_t   <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>int_fast64_t<span class="anglebracket">&gt;</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uint_fast64_t  <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uint_fast64_t<span class="anglebracket">&gt;</span>;                              <span class="comment">// freestanding</span>

  <span class="keyword">using</span> atomic_intptr_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>intptr_t<span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uintptr_t      <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uintptr_t<span class="anglebracket">&gt;</span>;                                  <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_size_t         <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>size_t<span class="anglebracket">&gt;</span>;                                     <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_ptrdiff_t      <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>ptrdiff_t<span class="anglebracket">&gt;</span>;                                  <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_intmax_t       <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>intmax_t<span class="anglebracket">&gt;</span>;                                   <span class="comment">// freestanding</span>
  <span class="keyword">using</span> atomic_uintmax_t      <span class="operator">=</span> atomic<span class="anglebracket">&lt;</span>uintmax_t<span class="anglebracket">&gt;</span>;                                  <span class="comment">// freestanding</span>

  <span class="keyword">using</span> atomic_signed_lock_free   <span class="operator">=</span> <i><span class="texttt">see below</span></i>;
  <span class="keyword">using</span> atomic_unsigned_lock_free <span class="operator">=</span> <i><span class="texttt">see below</span></i>;

  <span class="comment">// <a href="#flag" title="33.5.10 Flag type and operations">[atomics.<span class="shy"></span>flag]</a>, flag type and operations</span>
  <span class="keyword">struct</span> atomic_flag;                                                               <span class="comment">// freestanding</span>

  <span class="keyword">bool</span> atomic_flag_test<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                      <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">bool</span> atomic_flag_test_explicit<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span>,                       <span class="comment">// freestanding</span>
                                 memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test_explicit<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;        <span class="comment">// freestanding</span>
  <span class="keyword">bool</span> atomic_flag_test_and_set<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                    <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test_and_set<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                             <span class="comment">// freestanding</span>
  <span class="keyword">bool</span> atomic_flag_test_and_set_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span>,                     <span class="comment">// freestanding</span>
                                         memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test_and_set_explicit<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;      <span class="comment">// freestanding</span>
  <span class="keyword">void</span> atomic_flag_clear<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                           <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_clear<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                                    <span class="comment">// freestanding</span>
  <span class="keyword">void</span> atomic_flag_clear_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;    <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_clear_explicit<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;             <span class="comment">// freestanding</span>

  <span class="keyword">void</span> atomic_flag_wait<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span>, <span class="keyword">bool</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_wait<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span>, <span class="keyword">bool</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                         <span class="comment">// freestanding</span>
  <span class="keyword">void</span> atomic_flag_wait_explicit<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span>,                       <span class="comment">// freestanding</span>
                                 <span class="keyword">bool</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_wait_explicit<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span>,                                <span class="comment">// freestanding</span>
                                 <span class="keyword">bool</span>, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="keyword">void</span> atomic_flag_notify_one<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                      <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_notify_one<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                               <span class="comment">// freestanding</span>
  <span class="keyword">void</span> atomic_flag_notify_all<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                      <span class="comment">// freestanding</span>
  <span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_notify_all<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                               <span class="comment">// freestanding</span>
  <span class="preprocessordirective">#define</span> ATOMIC_FLAG_INIT <i><span class="texttt">see below</span></i>                                                <span class="comment">// freestanding</span>

  <span class="comment">// <a href="#fences" title="33.5.11 Fences">[atomics.<span class="shy"></span>fences]</a>, fences</span>
  <span class="keyword">extern</span> <span class="literal">"C"</span> <span class="added">constexpr </span><span class="keyword">void</span> atomic_thread_fence<span class="parenthesis">(</span>memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                       <span class="comment">// freestanding</span>
  <span class="keyword">extern</span> <span class="literal">"C"</span> <span class="added">constexpr </span><span class="keyword">void</span> atomic_signal_fence<span class="parenthesis">(</span>memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;                       <span class="comment">// freestanding</span>
<span class="curlybracket">}</span>
</span></span></div></div>
<div id="alias" class="section"><h3><a class="secnum" href="#alias" style="min-width:80pt">33.5.3</a> Type aliases <a class="abbr_ref" href="atomics.alias">[atomics.alias]</a></h3><div class="texpara"><a class="index" id="lib:atomic_bool"></a><a class="index" id="lib:atomic_char"></a><a class="index" id="lib:atomic_schar"></a><a class="index" id="lib:atomic_uchar"></a><a class="index" id="lib:atomic_short"></a><a class="index" id="lib:atomic_ushort"></a><a class="index" id="lib:atomic_int"></a><a class="index" id="lib:atomic_uint"></a><a class="index" id="lib:atomic_long"></a><a class="index" id="lib:atomic_ulong"></a><a class="index" id="lib:atomic_llong"></a><a class="index" id="lib:atomic_ullong"></a><a class="index" id="lib:atomic_char8_t"></a><a class="index" id="lib:atomic_char16_t"></a><a class="index" id="lib:atomic_char32_t"></a><a class="index" id="lib:atomic_wchar_t"></a><a class="index" id="lib:atomic_int8_t"></a><a class="index" id="lib:atomic_uint8_t"></a><a class="index" id="lib:atomic_int16_t"></a><a class="index" id="lib:atomic_uint16_t"></a><a class="index" id="lib:atomic_int32_t"></a><a class="index" id="lib:atomic_uint32_t"></a><a class="index" id="lib:atomic_int64_t"></a><a class="index" id="lib:atomic_uint64_t"></a><a class="index" id="lib:atomic_int_least8_t"></a><a class="index" id="lib:atomic_uint_least8_t"></a><a class="index" id="lib:atomic_int_least16_t"></a><a class="index" id="lib:atomic_uint_least16_t"></a><a class="index" id="lib:atomic_int_least32_t"></a><a class="index" id="lib:atomic_uint_least32_t"></a><a class="index" id="lib:atomic_int_least64_t"></a><a class="index" id="lib:atomic_uint_least64_t"></a><a class="index" id="lib:atomic_int_fast8_t"></a><a class="index" id="lib:atomic_uint_fast8_t"></a><a class="index" id="lib:atomic_int_fast16_t"></a><a class="index" id="lib:atomic_uint_fast16_t"></a><a class="index" id="lib:atomic_int_fast32_t"></a><a class="index" id="lib:atomic_uint_fast32_t"></a><a class="index" id="lib:atomic_int_fast64_t"></a><a class="index" id="lib:atomic_uint_fast64_t"></a><a class="index" id="lib:atomic_intptr_t"></a><a class="index" id="lib:atomic_uintptr_t"></a><a class="index" id="lib:atomic_size_t"></a><a class="index" id="lib:atomic_ptrdiff_t"></a><a class="index" id="lib:atomic_intmax_t"></a><a class="index" id="lib:atomic_uintmax_t"></a></div><div class="para" id="alias-1"><div class="marginalizedparent"><a class="marginalized" href="#alias-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2455">#</a></div><div class="texpara"><div id="alias-1.sentence-1" class="sentence">The type aliases <span class="texttt">atomic_<span class="shy"></span>int<span class="math"><span class="mathalpha">N</span></span>_<span class="shy"></span>t</span>, <span class="texttt">atomic_<span class="shy"></span>uint<span class="math"><span class="mathalpha">N</span></span>_<span class="shy"></span>t</span>,
<span class="texttt">atomic_<span class="shy"></span>intptr_<span class="shy"></span>t</span>, and <span class="texttt">atomic_<span class="shy"></span>uintptr_<span class="shy"></span>t</span>
are defined if and only if
<span class="texttt"><span class="keyword">int</span><span class="math"><span class="mathalpha">N</span></span>_<span class="shy"></span>t</span>, <span class="texttt">uint<span class="math"><span class="mathalpha">N</span></span>_<span class="shy"></span>t</span>,
<span class="texttt">intptr_<span class="shy"></span>t</span>, and <span class="texttt">uintptr_<span class="shy"></span>t</span>
are defined, respectively<a class="hidden_link" href="#alias-1.sentence-1">.</a></div></div></div><div class="para" id="alias-2"><div class="marginalizedparent"><a class="marginalized" href="#alias-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2463">#</a></div><div class="texpara"><div id="alias-2.sentence-1" class="sentence"><a class="index" id="lib:atomic_signed_lock_free"></a><a class="index" id="lib:atomic_unsigned_lock_free"></a>The type aliases
<span class="texttt">atomic_<span class="shy"></span>signed_<span class="shy"></span>lock_<span class="shy"></span>free</span> and <span class="texttt">atomic_<span class="shy"></span>unsigned_<span class="shy"></span>lock_<span class="shy"></span>free</span>
name specializations of <span class="texttt">atomic</span>
whose template arguments are integral types, respectively signed and unsigned,
and whose <span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> property is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#alias-2.sentence-1">.</a></div> <div id="alias-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#alias-note-1">1</a></i>: <div id="alias-2.sentence-2" class="sentence"><a class="index" id=":implementation,freestanding"></a>These aliases are optional in freestanding implementations (<a href="compliance" title="16.4.2.5 Freestanding implementations">[compliance]</a>)<a class="hidden_link" href="#alias-2.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div> <div id="alias-2.sentence-3" class="sentence">
Implementations should choose for these aliases
the integral specializations of <span class="texttt">atomic</span>
for which the atomic waiting and notifying operations (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)
are most efficient<a class="hidden_link" href="#alias-2.sentence-3">.</a></div></div></div></div>
<div id="order" class="section"><h3><a class="secnum" href="#order" style="min-width:80pt">33.5.4</a> Order and consistency <a class="abbr_ref" href="atomics.order">[atomics.order]</a></h3><div class="texpara"><a class="index" id="lib:memory_order"></a><a class="index" id="lib:relaxed,memory_order"></a><a class="index" id="lib:memory_order,relaxed"></a><a class="index" id="lib:consume,memory_order"></a><a class="index" id="lib:memory_order,consume"></a><a class="index" id="lib:acquire,memory_order"></a><a class="index" id="lib:memory_order,acquire"></a><a class="index" id="lib:release,memory_order"></a><a class="index" id="lib:memory_order,release"></a><a class="index" id="lib:acq_rel,memory_order"></a><a class="index" id="lib:memory_order,acq_rel"></a><a class="index" id="lib:seq_cst,memory_order"></a><a class="index" id="lib:memory_order,seq_cst"></a><a class="index" id="lib:memory_order_relaxed"></a><a class="index" id="lib:memory_order_consume"></a><a class="index" id="lib:memory_order_acquire"></a><a class="index" id="lib:memory_order_release"></a><a class="index" id="lib:memory_order_acq_rel"></a><a class="index" id="lib:memory_order_seq_cst"></a>
<span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">enum</span> <span class="keyword">class</span> memory_order <span class="operator">:</span> <i><span class="texttt">unspecified</span></i> <span class="curlybracket">{</span>
    relaxed, consume, acquire, release, acq_rel, seq_cst
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div><div class="para" id="order-1"><div class="marginalizedparent"><a class="marginalized" href="#order-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2503">#</a></div><div class="texpara"><div id="order-1.sentence-1" class="sentence">The enumeration <span class="texttt">memory_<span class="shy"></span>order</span> specifies the detailed regular
(non-atomic) memory synchronization order as defined in
<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a> and may provide for operation ordering<a class="hidden_link" href="#order-1.sentence-1">.</a></div> <div id="order-1.sentence-2" class="sentence">Its
enumerated values and their meanings are as follows:</div></div><div class="texpara"><ul class="itemize"><li id="order-1.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-1.1">(1.1)</a></div><div class="texpara"><div id="order-1.1.sentence-1" class="sentence"><span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>: no operation orders memory<a class="hidden_link" href="#order-1.1.sentence-1">.</a></div></div></li><li id="order-1.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-1.2">(1.2)</a></div><div class="texpara"><div id="order-1.2.sentence-1" class="sentence"><span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>, <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>, and
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span>: a store operation performs a release operation on the
affected memory location<a class="hidden_link" href="#order-1.2.sentence-1">.</a></div></div></li><li id="order-1.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-1.3">(1.3)</a></div><div class="texpara"><div id="order-1.3.sentence-1" class="sentence"><span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>: a load operation performs a consume operation on the
affected memory location<a class="hidden_link" href="#order-1.3.sentence-1">.</a></div> <div id="order-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-1">1</a></i>: <div id="order-1.3.sentence-2" class="sentence">Prefer <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span>, which provides stronger guarantees
than <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span><a class="hidden_link" href="#order-1.3.sentence-2">.</a></div> <div id="order-1.3.sentence-3" class="sentence">Implementations have found it infeasible
to provide performance better than that of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span><a class="hidden_link" href="#order-1.3.sentence-3">.</a></div> <div id="order-1.3.sentence-4" class="sentence">Specification revisions are under consideration<a class="hidden_link" href="#order-1.3.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></li><li id="order-1.4"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-1.4">(1.4)</a></div><div class="texpara"><div id="order-1.4.sentence-1" class="sentence"><span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span>, <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>, and
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span>: a load operation performs an acquire operation on the
affected memory location<a class="hidden_link" href="#order-1.4.sentence-1">.</a></div></div></li></ul></div><div class="texpara"><div id="order-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-2">2</a></i>: <div id="order-1.sentence-3" class="sentence">Atomic operations specifying <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span> are relaxed
with respect to memory ordering<a class="hidden_link" href="#order-1.sentence-3">.</a></div> <div id="order-1.sentence-4" class="sentence">Implementations must still guarantee that any
given atomic access to a particular atomic object be indivisible with respect
to all other atomic accesses to that object<a class="hidden_link" href="#order-1.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para" id="order-2"><div class="marginalizedparent"><a class="marginalized" href="#order-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2537">#</a></div><div class="texpara"><div id="order-2.sentence-1" class="sentence">An atomic operation <span class="math"><span class="mathalpha">A</span></span> that performs a release operation on an atomic
object <span class="math"><span class="mathalpha">M</span></span> synchronizes with an atomic operation <span class="math"><span class="mathalpha">B</span></span> that performs
an acquire operation on <span class="math"><span class="mathalpha">M</span></span> and takes its value from any side effect in the
release sequence headed by <span class="math"><span class="mathalpha">A</span></span><a class="hidden_link" href="#order-2.sentence-1">.</a></div></div></div><div class="para" id="order-3"><div class="marginalizedparent"><a class="marginalized" href="#order-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2543">#</a></div><div class="texpara"><div id="order-3.sentence-1" class="sentence">An atomic operation <span class="math"><span class="mathalpha">A</span></span> on some atomic object <span class="math"><span class="mathalpha">M</span></span> is
<a class="hidden_link" href="#def:coherence-ordered_before" title="33.5.4 Order and consistency [atomics.order]"><span id="def:coherence-ordered_before"><i>coherence-ordered before</i></span></a>
another atomic operation <span class="math"><span class="mathalpha">B</span></span> on <span class="math"><span class="mathalpha">M</span></span> if
<ul class="itemize"><li id="order-3.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-3.1">(3.1)</a></div><span class="math"><span class="mathalpha">A</span></span> is a modification, and
<span class="math"><span class="mathalpha">B</span></span> reads the value stored by <span class="math"><span class="mathalpha">A</span></span>, or</li><li id="order-3.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-3.2">(3.2)</a></div><span class="math"><span class="mathalpha">A</span></span> precedes <span class="math"><span class="mathalpha">B</span></span>
in the modification order of <span class="math"><span class="mathalpha">M</span></span>, or</li><li id="order-3.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-3.3">(3.3)</a></div><span class="math"><span class="mathalpha">A</span></span> and <span class="math"><span class="mathalpha">B</span></span> are not
the same atomic read-modify-write operation, and
there exists an atomic modification <span class="math"><span class="mathalpha">X</span></span> of <span class="math"><span class="mathalpha">M</span></span>
such that <span class="math"><span class="mathalpha">A</span></span> reads the value stored by <span class="math"><span class="mathalpha">X</span></span> and
<span class="math"><span class="mathalpha">X</span></span> precedes <span class="math"><span class="mathalpha">B</span></span>
in the modification order of <span class="math"><span class="mathalpha">M</span></span>, or</li><li id="order-3.4"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-3.4">(3.4)</a></div>there exists an atomic modification <span class="math"><span class="mathalpha">X</span></span> of <span class="math"><span class="mathalpha">M</span></span>
such that <span class="math"><span class="mathalpha">A</span></span> is coherence-ordered before <span class="math"><span class="mathalpha">X</span></span> and
<span class="math"><span class="mathalpha">X</span></span> is coherence-ordered before <span class="math"><span class="mathalpha">B</span></span><a class="hidden_link" href="#order-3.sentence-1">.</a></li></ul></div></div></div><div class="para" id="order-4"><div class="marginalizedparent"><a class="marginalized" href="#order-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2563">#</a></div><div class="texpara"><div id="order-4.sentence-1" class="sentence">There is a single total order <span class="math"><span class="mathalpha">S</span></span>
on all <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> operations, including fences,
that satisfies the following constraints<a class="hidden_link" href="#order-4.sentence-1">.</a></div> <div id="order-4.sentence-2" class="sentence">First, if <span class="math"><span class="mathalpha">A</span></span> and <span class="math"><span class="mathalpha">B</span></span> are
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> operations and
<span class="math"><span class="mathalpha">A</span></span> strongly happens before <span class="math"><span class="mathalpha">B</span></span>,
then <span class="math"><span class="mathalpha">A</span></span> precedes <span class="math"><span class="mathalpha">B</span></span> in <span class="math"><span class="mathalpha">S</span></span><a class="hidden_link" href="#order-4.sentence-2">.</a></div> <div id="order-4.sentence-3" class="sentence">Second, for every pair of atomic operations <span class="math"><span class="mathalpha">A</span></span> and
<span class="math"><span class="mathalpha">B</span></span> on an object <span class="math"><span class="mathalpha">M</span></span>,
where <span class="math"><span class="mathalpha">A</span></span> is coherence-ordered before <span class="math"><span class="mathalpha">B</span></span>,
the following four conditions are required to be satisfied by <span class="math"><span class="mathalpha">S</span></span>:
<ul class="itemize"><li id="order-4.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-4.1">(4.1)</a></div>if <span class="math"><span class="mathalpha">A</span></span> and <span class="math"><span class="mathalpha">B</span></span> are both
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> operations,
then <span class="math"><span class="mathalpha">A</span></span> precedes <span class="math"><span class="mathalpha">B</span></span> in <span class="math"><span class="mathalpha">S</span></span>; and</li><li id="order-4.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-4.2">(4.2)</a></div>if <span class="math"><span class="mathalpha">A</span></span> is a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> operation and
<span class="math"><span class="mathalpha">B</span></span> happens before
a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> fence <span class="math"><span class="mathalpha">Y</span></span>,
then <span class="math"><span class="mathalpha">A</span></span> precedes <span class="math"><span class="mathalpha">Y</span></span> in <span class="math"><span class="mathalpha">S</span></span>; and</li><li id="order-4.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-4.3">(4.3)</a></div>if a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> fence <span class="math"><span class="mathalpha">X</span></span>
happens before <span class="math"><span class="mathalpha">A</span></span> and
<span class="math"><span class="mathalpha">B</span></span> is a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> operation,
then <span class="math"><span class="mathalpha">X</span></span> precedes <span class="math"><span class="mathalpha">B</span></span> in <span class="math"><span class="mathalpha">S</span></span>; and</li><li id="order-4.4"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#order-4.4">(4.4)</a></div>if a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> fence <span class="math"><span class="mathalpha">X</span></span>
happens before <span class="math"><span class="mathalpha">A</span></span> and
<span class="math"><span class="mathalpha">B</span></span> happens before
a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> fence <span class="math"><span class="mathalpha">Y</span></span>,
then <span class="math"><span class="mathalpha">X</span></span> precedes <span class="math"><span class="mathalpha">Y</span></span> in <span class="math"><span class="mathalpha">S</span></span><a class="hidden_link" href="#order-4.sentence-3">.</a></li></ul></div></div></div><div class="para nonNormativeOnly" id="order-5"><div class="marginalizedparent"><a class="marginalized" href="#order-5">5</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2594">#</a></div><div class="texpara"><div id="order-note-3" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-3">3</a></i>: <div id="order-5.sentence-1" class="sentence">This definition ensures that <span class="math"><span class="mathalpha">S</span></span> is consistent with
the modification order of any atomic object <span class="math"><span class="mathalpha">M</span></span><a class="hidden_link" href="#order-5.sentence-1">.</a></div> <div id="order-5.sentence-2" class="sentence">It also ensures that
a <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> load <span class="math"><span class="mathalpha">A</span></span> of <span class="math"><span class="mathalpha">M</span></span>
gets its value either from the last modification of <span class="math"><span class="mathalpha">M</span></span>
that precedes <span class="math"><span class="mathalpha">A</span></span> in <span class="math"><span class="mathalpha">S</span></span> or
from some non-<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> modification of <span class="math"><span class="mathalpha">M</span></span>
that does not happen before any modification of <span class="math"><span class="mathalpha">M</span></span>
that precedes <span class="math"><span class="mathalpha">A</span></span> in <span class="math"><span class="mathalpha">S</span></span><a class="hidden_link" href="#order-5.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para nonNormativeOnly" id="order-6"><div class="marginalizedparent"><a class="marginalized" href="#order-6">6</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2607">#</a></div><div class="texpara"><div id="order-note-4" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-4">4</a></i>: <div id="order-6.sentence-1" class="sentence">We do not require that <span class="math"><span class="mathalpha">S</span></span> be consistent with
“happens before” (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#order-6.sentence-1">.</a></div> <div id="order-6.sentence-2" class="sentence">This allows more efficient implementation
of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>
on some machine architectures<a class="hidden_link" href="#order-6.sentence-2">.</a></div> <div id="order-6.sentence-3" class="sentence">It can produce surprising results
when these are mixed with <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> accesses<a class="hidden_link" href="#order-6.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para nonNormativeOnly" id="order-7"><div class="marginalizedparent"><a class="marginalized" href="#order-7">7</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2618">#</a></div><div class="texpara"><div id="order-note-5" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-5">5</a></i>: <div id="order-7.sentence-1" class="sentence"><span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> ensures sequential consistency only
for a program that is free of data races and
uses exclusively <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> atomic operations<a class="hidden_link" href="#order-7.sentence-1">.</a></div> <div id="order-7.sentence-2" class="sentence">Any use of weaker ordering will invalidate this guarantee
unless extreme care is used<a class="hidden_link" href="#order-7.sentence-2">.</a></div> <div id="order-7.sentence-3" class="sentence">In many cases, <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span> atomic operations are reorderable
with respect to other atomic operations performed by the same thread<a class="hidden_link" href="#order-7.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para" id="order-8"><div class="marginalizedparent"><a class="marginalized" href="#order-8">8</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2629">#</a></div><div class="texpara"><div id="order-8.sentence-1" class="sentence">Implementations should ensure that no “out-of-thin-air” values are computed that
circularly depend on their own computation<a class="hidden_link" href="#order-8.sentence-1">.</a></div></div><div class="texpara"><div id="order-note-6" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-6">6</a></i>: <div id="order-8.sentence-2" class="sentence">For example, with <span class="texttt">x</span> and <span class="texttt">y</span> initially zero,
<span class="codeblock"><span class="comment">// Thread 1:</span>
r1 <span class="operator">=</span> y<span class="operator">.</span>load<span class="parenthesis">(</span>memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
x<span class="operator">.</span>store<span class="parenthesis">(</span>r1, memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
</span></div></div><div class="texpara"><div id="order-8.sentence-3" class="sentence"><span class="codeblock"><span class="comment">// Thread 2:</span>
r2 <span class="operator">=</span> x<span class="operator">.</span>load<span class="parenthesis">(</span>memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
y<span class="operator">.</span>store<span class="parenthesis">(</span>r2, memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
</span>
this recommendation discourages producing <span class="texttt">r1 <span class="operator">=</span><span class="operator">=</span> r2 <span class="operator">=</span><span class="operator">=</span> <span class="literal">42</span></span>, since the store of 42 to <span class="texttt">y</span> is only
possible if the store to <span class="texttt">x</span> stores <span class="texttt"><span class="literal">42</span></span>, which circularly depends on the
store to <span class="texttt">y</span> storing <span class="texttt"><span class="literal">42</span></span><a class="hidden_link" href="#order-8.sentence-3">.</a></div> <div id="order-8.sentence-4" class="sentence">Note that without this restriction, such an
execution is possible<a class="hidden_link" href="#order-8.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para nonNormativeOnly" id="order-9"><div class="marginalizedparent"><a class="marginalized" href="#order-9">9</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2652">#</a></div><div class="texpara"><div id="order-note-7" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#order-note-7">7</a></i>: <div id="order-9.sentence-1" class="sentence">The recommendation similarly disallows <span class="texttt">r1 <span class="operator">=</span><span class="operator">=</span> r2 <span class="operator">=</span><span class="operator">=</span> <span class="literal">42</span></span> in the
following example, with <span class="texttt">x</span> and <span class="texttt">y</span> again initially zero:</div></div><div class="texpara"><span class="codeblock"><span class="comment">// Thread 1:</span>
r1 <span class="operator">=</span> x<span class="operator">.</span>load<span class="parenthesis">(</span>memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
<span class="keyword">if</span> <span class="parenthesis">(</span>r1 <span class="operator">=</span><span class="operator">=</span> <span class="literal">42</span><span class="parenthesis">)</span> y<span class="operator">.</span>store<span class="parenthesis">(</span><span class="literal">42</span>, memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
</span></div><div class="texpara"><span class="codeblock"><span class="comment">// Thread 2:</span>
r2 <span class="operator">=</span> y<span class="operator">.</span>load<span class="parenthesis">(</span>memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
<span class="keyword">if</span> <span class="parenthesis">(</span>r2 <span class="operator">=</span><span class="operator">=</span> <span class="literal">42</span><span class="parenthesis">)</span> x<span class="operator">.</span>store<span class="parenthesis">(</span><span class="literal">42</span>, memory_order<span class="operator">::</span>relaxed<span class="parenthesis">)</span>;
</span> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para" id="order-10"><div class="marginalizedparent"><a class="marginalized" href="#order-10">10</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2670">#</a></div><div class="texpara"><div id="order-10.sentence-1" class="sentence">Atomic read-modify-write operations shall always read the last value
(in the modification order) written before the write associated with
the read-modify-write operation<a class="hidden_link" href="#order-10.sentence-1">.</a></div></div></div><div class="para" id="order-11"><div class="marginalizedparent"><a class="marginalized" href="#order-11">11</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2675">#</a></div><div class="texpara"><div id="order-11.sentence-1" class="sentence"><i>Recommended practice</i>: The implementation should make atomic stores visible to atomic loads,
and atomic loads should observe atomic stores,
within a reasonable amount of time<a class="hidden_link" href="#order-11.sentence-1">.</a></div></div></div><div class="texpara"><div id="lib:kill_dependency"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:kill_dependency">🔗</a></div><code class="itemdeclcode"><span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
  <span class="added">constexpr </span>T kill_dependency<span class="parenthesis">(</span>T y<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="order-12"><div class="marginalizedparent"><a class="marginalized" href="#order-12">12</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2688">#</a></div><div class="texpara"><div id="order-12.sentence-1" class="sentence"><i>Effects</i>: The argument does not carry a dependency to the return
value (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#order-12.sentence-1">.</a></div></div></div></div><div class="para" id="order-13"><div class="marginalizedparent"><a class="marginalized" href="#order-13">13</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2693">#</a></div><div class="texpara"><div id="order-13.sentence-1" class="sentence"><i>Returns</i>: <span class="texttt">y</span><a class="hidden_link" href="#order-13.sentence-1">.</a></div></div></div></div></div>
<div id="lockfree" class="section"><h3><a class="secnum" href="#lockfree" style="min-width:80pt">33.5.5</a> Lock-free property <a class="abbr_ref" href="atomics.lockfree">[atomics.lockfree]</a></h3><div class="texpara"><span id=":values_of_various_ATOMIC_..._LOCK_FREE_macros"><span id="lib:ATOMIC_POINTER_LOCK_FREE"><span id="lib:ATOMIC_LLONG_LOCK_FREE"><span id="lib:ATOMIC_LONG_LOCK_FREE"><span id="lib:ATOMIC_INT_LOCK_FREE"><span id="lib:ATOMIC_SHORT_LOCK_FREE"><span id="lib:ATOMIC_WCHAR_T_LOCK_FREE"><span id="lib:ATOMIC_CHAR32_T_LOCK_FREE"><span id="lib:ATOMIC_CHAR16_T_LOCK_FREE"><span id="lib:ATOMIC_CHAR8_T_LOCK_FREE"><span id="lib:ATOMIC_CHAR_LOCK_FREE"><span id="lib:ATOMIC_BOOL_LOCK_FREE"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:ATOMIC_BOOL_LOCK_FREE">🔗</a></div><span class="codeblock"><span class="preprocessordirective">#define</span> ATOMIC_BOOL_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR8_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR16_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR32_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_WCHAR_T_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_SHORT_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_INT_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_LONG_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_LLONG_LOCK_FREE <i><span class="texttt">unspecified</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_POINTER_LOCK_FREE <i><span class="texttt">unspecified</span></i>
</span></span></span></span></span></span></span></span></span></span></span></span></span></div><div class="para" id="lockfree-1"><div class="marginalizedparent"><a class="marginalized" href="#lockfree-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2727">#</a></div><div class="texpara"><div id="lockfree-1.sentence-1" class="sentence">The <span class="texttt">ATOMIC_<span class="shy"></span><span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>_<span class="shy"></span>LOCK_<span class="shy"></span>FREE</span> macros indicate the lock-free property of the
corresponding atomic types, with the signed and unsigned variants grouped
together<a class="hidden_link" href="#lockfree-1.sentence-1">.</a></div> <div id="lockfree-1.sentence-2" class="sentence">The properties also apply to the corresponding (partial) specializations of the
<span class="texttt">atomic</span> template<a class="hidden_link" href="#lockfree-1.sentence-2">.</a></div> <div id="lockfree-1.sentence-3" class="sentence">A value of 0 indicates that the types are never
lock-free<a class="hidden_link" href="#lockfree-1.sentence-3">.</a></div> <div id="lockfree-1.sentence-4" class="sentence">A value of 1 indicates that the types are sometimes lock-free<a class="hidden_link" href="#lockfree-1.sentence-4">.</a></div> <div id="lockfree-1.sentence-5" class="sentence">A
value of 2 indicates that the types are always lock-free<a class="hidden_link" href="#lockfree-1.sentence-5">.</a></div></div></div><div class="para" id="lockfree-2"><div class="marginalizedparent"><a class="marginalized" href="#lockfree-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2735">#</a></div><div class="texpara"><div id="lockfree-2.sentence-1" class="sentence">On a hosted implementation (<a href="compliance" title="16.4.2.5 Freestanding implementations">[compliance]</a>),
at least one signed integral specialization of the <span class="texttt">atomic</span> template,
along with the specialization
for the corresponding unsigned type (<a href="basic.fundamental" title="6.8.2 Fundamental types">[basic.<span class="shy"></span>fundamental]</a>),
is always lock-free<a class="hidden_link" href="#lockfree-2.sentence-1">.</a></div></div></div><div class="para" id="lockfree-3"><div class="marginalizedparent"><a class="marginalized" href="#lockfree-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2742">#</a></div><div class="texpara"><div id="lockfree-3.sentence-1" class="sentence">The functions <span class="texttt">atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>is_<span class="shy"></span>lock_<span class="shy"></span>free</span> and
<span class="texttt">atomic_<span class="shy"></span>is_<span class="shy"></span>lock_<span class="shy"></span>free</span> (<a href="#types.operations" title="33.5.8.2 Operations on atomic types">[atomics.<span class="shy"></span>types.<span class="shy"></span>operations]</a>)
indicate whether the object is lock-free<a class="hidden_link" href="#lockfree-3.sentence-1">.</a></div> <div id="lockfree-3.sentence-2" class="sentence">In any given program execution, the
result of the lock-free query
is the same for all atomic objects of the same type<a class="hidden_link" href="#lockfree-3.sentence-2">.</a></div></div></div><div class="para" id="lockfree-4"><div class="marginalizedparent"><a class="marginalized" href="#lockfree-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2749">#</a></div><div class="texpara"><div id="lockfree-4.sentence-1" class="sentence">Atomic operations that are not lock-free are considered to potentially
block (<a href="intro.progress" title="6.9.2.3 Forward progress">[intro.<span class="shy"></span>progress]</a>)<a class="hidden_link" href="#lockfree-4.sentence-1">.</a></div></div></div><div class="para" id="lockfree-5"><div class="marginalizedparent"><a class="marginalized" href="#lockfree-5">5</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2753">#</a></div><div class="texpara"><div id="lockfree-5.sentence-1" class="sentence"><i>Recommended practice</i>: Operations that are lock-free should also be address-free<a class="hidden_link" href="#lockfree-5.sentence-1">.</a><a class="footnoteref" href="#footnote-301" id="footnoteref-301" title="That is, atomic operations on the same memory location via two different addresses will communicate atomically.">301</a></div> <div id="lockfree-5.sentence-2" class="sentence">
The implementation of these operations should not depend on any per-process state<a class="hidden_link" href="#lockfree-5.sentence-2">.</a></div> <div id="lockfree-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#lockfree-note-1">1</a></i>: <div id="lockfree-5.sentence-3" class="sentence">This restriction enables communication by memory that is
mapped into a process more than once and by memory that is shared between two
processes<a class="hidden_link" href="#lockfree-5.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="footnoteSeparator"></div><div class="footnote" id="footnote-301"><div class="texpara"><a class="footnotenum" href="#footnote-301">301)</a><a class="footnoteBacklink" href="#footnoteref-301">301)</a> <div id="footnote-301.sentence-1" class="sentence">That is,
atomic operations on the same memory location via two different addresses will
communicate atomically<a class="hidden_link" href="#footnote-301.sentence-1">.</a></div></div></div></div>
<div id="wait" class="section"><h3><a class="secnum" href="#wait" style="min-width:80pt">33.5.6</a> Waiting and notifying <a class="abbr_ref" href="atomics.wait">[atomics.wait]</a></h3><div class="para" id="wait-1"><div class="marginalizedparent"><a class="marginalized" href="#wait-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2770">#</a></div><div class="texpara"><div id="wait-1.sentence-1" class="sentence"><a class="hidden_link" href="#def:atomic,waiting_operation" title="33.5.6 Waiting and notifying [atomics.wait]"><span id="def:atomic,waiting_operation"><i>Atomic waiting operations</i></span></a>
and <a class="hidden_link" href="#def:atomic,notifying_operation" title="33.5.6 Waiting and notifying [atomics.wait]"><span id="def:atomic,notifying_operation"><i>atomic notifying operations</i></span></a>
provide a mechanism to wait for the value of an atomic object to change
more efficiently than can be achieved with polling<a class="hidden_link" href="#wait-1.sentence-1">.</a></div> <div id="wait-1.sentence-2" class="sentence">An atomic waiting operation may block until it is unblocked
by an atomic notifying operation, according to each function's effects<a class="hidden_link" href="#wait-1.sentence-2">.</a></div> <div id="wait-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#wait-note-1">1</a></i>: <div id="wait-1.sentence-3" class="sentence">Programs are not guaranteed to observe transient atomic values,
an issue known as the A-B-A problem,
resulting in continued blocking if a condition is only temporarily met<a class="hidden_link" href="#wait-1.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para nonNormativeOnly" id="wait-2"><div class="marginalizedparent"><a class="marginalized" href="#wait-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2783">#</a></div><div class="texpara"><div id="wait-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#wait-note-2">2</a></i>: <div id="wait-2.sentence-1" class="sentence">The following functions are atomic waiting operations:
<ul class="itemize"><li id="wait-2.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-2.1">(2.1)</a></div><span class="texttt">atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>wait</span>,</li><li id="wait-2.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-2.2">(2.2)</a></div><span class="texttt">atomic_<span class="shy"></span>flag<span class="operator">​::​</span>wait</span>,</li><li id="wait-2.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-2.3">(2.3)</a></div><span class="texttt">atomic_<span class="shy"></span>wait</span> and <span class="texttt">atomic_<span class="shy"></span>wait_<span class="shy"></span>explicit</span>,</li><li id="wait-2.4"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-2.4">(2.4)</a></div><span class="texttt">atomic_<span class="shy"></span>flag_<span class="shy"></span>wait</span> and <span class="texttt">atomic_<span class="shy"></span>flag_<span class="shy"></span>wait_<span class="shy"></span>explicit</span>, and</li><li id="wait-2.5"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-2.5">(2.5)</a></div><span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>wait</span><a class="hidden_link" href="#wait-2.sentence-1">.</a></li></ul></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para nonNormativeOnly" id="wait-3"><div class="marginalizedparent"><a class="marginalized" href="#wait-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2795">#</a></div><div class="texpara"><div id="wait-note-3" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#wait-note-3">3</a></i>: <div id="wait-3.sentence-1" class="sentence">The following functions are atomic notifying operations:
<ul class="itemize"><li id="wait-3.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-3.1">(3.1)</a></div><span class="texttt">atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>notify_<span class="shy"></span>one</span> and <span class="texttt">atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>notify_<span class="shy"></span>all</span>,</li><li id="wait-3.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-3.2">(3.2)</a></div><span class="texttt">atomic_<span class="shy"></span>flag<span class="operator">​::​</span>notify_<span class="shy"></span>one</span> and <span class="texttt">atomic_<span class="shy"></span>flag<span class="operator">​::​</span>notify_<span class="shy"></span>all</span>,</li><li id="wait-3.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-3.3">(3.3)</a></div><span class="texttt">atomic_<span class="shy"></span>notify_<span class="shy"></span>one</span> and <span class="texttt">atomic_<span class="shy"></span>notify_<span class="shy"></span>all</span>,</li><li id="wait-3.4"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-3.4">(3.4)</a></div><span class="texttt">atomic_<span class="shy"></span>flag_<span class="shy"></span>notify_<span class="shy"></span>one</span> and <span class="texttt">atomic_<span class="shy"></span>flag_<span class="shy"></span>notify_<span class="shy"></span>all</span>, and</li><li id="wait-3.5"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-3.5">(3.5)</a></div><span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>notify_<span class="shy"></span>one</span> and <span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>notify_<span class="shy"></span>all</span><a class="hidden_link" href="#wait-3.sentence-1">.</a></li></ul></div> —&nbsp;<i>end note</i>]</div></div> <a class="index" id=":atomic,waiting_operation,eligible_to_be_unblocked"></a></div></div><div class="para" id="wait-4"><div class="marginalizedparent"><a class="marginalized" href="#wait-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2808">#</a></div><div class="texpara"><div id="wait-4.sentence-1" class="sentence">A call to an atomic waiting operation on an atomic object <span class="texttt">M</span>
is <a class="hidden_link" href="#def:eligible_to_be_unblocked" title="33.5.6 Waiting and notifying [atomics.wait]"><span id="def:eligible_to_be_unblocked"><i>eligible to be unblocked</i></span></a>
by a call to an atomic notifying operation on <span class="texttt">M</span>
if there exist side effects <span class="texttt">X</span> and <span class="texttt">Y</span> on <span class="texttt">M</span> such that:
<ul class="itemize"><li id="wait-4.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-4.1">(4.1)</a></div>the atomic waiting operation has blocked after observing the result of <span class="texttt">X</span>,</li><li id="wait-4.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-4.2">(4.2)</a></div><span class="texttt">X</span> precedes <span class="texttt">Y</span> in the modification order of <span class="texttt">M</span>, and</li><li id="wait-4.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#wait-4.3">(4.3)</a></div><span class="texttt">Y</span> happens before the call to the atomic notifying operation<a class="hidden_link" href="#wait-4.sentence-1">.</a></li></ul></div></div></div></div>
<div id="ref.generic" class="section"><h3><a class="secnum" href="#ref.generic" style="min-width:80pt">33.5.7</a> Class template <span class="texttt">atomic_<span class="shy"></span>ref</span> <a class="abbr_ref" href="atomics.ref.generic">[atomics.ref.generic]</a></h3><div id="ref.generic.general" class="section"><h4><a class="secnum" href="#ref.generic.general" style="min-width:95pt">33.5.7.1</a> General <a class="abbr_ref" href="atomics.ref.generic.general">[atomics.ref.generic.general]</a></h4><div class="texpara"><span id="lib:atomic_ref,value_type"><span id="lib:value_type,atomic_ref"><span id="lib:atomic_ref"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_ref">🔗</a></div><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic_ref <span class="curlybracket">{</span>
  <span class="keyword">private</span><span class="operator">:</span>
    T<span class="operator">*</span> ptr;             <span class="comment">// <i>exposition only</i></span>

  <span class="keyword">public</span><span class="operator">:</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> T;
    <span class="keyword">static</span> <span class="keyword">constexpr</span> size_t required_alignment <span class="operator">=</span> <a class="index" id=":required_alignment_for_atomic_ref_type's_operations"></a><i>implementation-defined</i>;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_ref_type's_operations_are_always_lock_free"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">explicit</span> atomic_ref<span class="parenthesis">(</span>T<span class="operator">&amp;</span><span class="parenthesis">)</span>;
    <span class="added">constexpr </span>atomic_ref<span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic_ref<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> T<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span>T exchange<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></span></span></span></div><div class="para" id="ref.generic.general-1"><div class="marginalizedparent"><a class="marginalized" href="#ref.generic.general-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2864">#</a></div><div class="texpara"><div id="ref.generic.general-1.sentence-1" class="sentence">An <span class="texttt">atomic_<span class="shy"></span>ref</span> object applies atomic operations (<a href="#general" title="33.5.1 General">[atomics.<span class="shy"></span>general]</a>) to
the object referenced by <span class="texttt"><span class="operator">*</span>ptr</span> such that,
for the lifetime (<a href="basic.life" title="6.7.3 Lifetime">[basic.<span class="shy"></span>life]</a>) of the <span class="texttt">atomic_<span class="shy"></span>ref</span> object,
the object referenced by <span class="texttt"><span class="operator">*</span>ptr</span> is an atomic object (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#ref.generic.general-1.sentence-1">.</a></div></div></div><div class="para" id="ref.generic.general-2"><div class="marginalizedparent"><a class="marginalized" href="#ref.generic.general-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2870">#</a></div><div class="texpara"><div id="ref.generic.general-2.sentence-1" class="sentence">The program is ill-formed if <span class="texttt">is_<span class="shy"></span>trivially_<span class="shy"></span>copyable_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span> is <span class="texttt"><span class="literal">false</span></span><a class="hidden_link" href="#ref.generic.general-2.sentence-1">.</a></div></div></div><div class="para" id="ref.generic.general-3"><div class="marginalizedparent"><a class="marginalized" href="#ref.generic.general-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2873">#</a></div><div class="texpara"><div id="ref.generic.general-3.sentence-1" class="sentence">The lifetime (<a href="basic.life" title="6.7.3 Lifetime">[basic.<span class="shy"></span>life]</a>) of an object referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
shall exceed the lifetime of all <span class="texttt">atomic_<span class="shy"></span>ref</span>s that reference the object<a class="hidden_link" href="#ref.generic.general-3.sentence-1">.</a></div> <div id="ref.generic.general-3.sentence-2" class="sentence">While any <span class="texttt">atomic_<span class="shy"></span>ref</span> instances exist
that reference the <span class="texttt"><span class="operator">*</span>ptr</span> object,
all accesses to that object shall exclusively occur
through those <span class="texttt">atomic_<span class="shy"></span>ref</span> instances<a class="hidden_link" href="#ref.generic.general-3.sentence-2">.</a></div> <div id="ref.generic.general-3.sentence-3" class="sentence">No subobject of the object referenced by <span class="texttt">atomic_<span class="shy"></span>ref</span>
shall be concurrently referenced by any other <span class="texttt">atomic_<span class="shy"></span>ref</span> object<a class="hidden_link" href="#ref.generic.general-3.sentence-3">.</a></div></div></div><div class="para" id="ref.generic.general-4"><div class="marginalizedparent"><a class="marginalized" href="#ref.generic.general-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2883">#</a></div><div class="texpara"><div id="ref.generic.general-4.sentence-1" class="sentence">Atomic operations applied to an object
through a referencing <span class="texttt">atomic_<span class="shy"></span>ref</span> are atomic with respect to
atomic operations applied through any other <span class="texttt">atomic_<span class="shy"></span>ref</span>
referencing the same object<a class="hidden_link" href="#ref.generic.general-4.sentence-1">.</a></div> <div id="ref.generic.general-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#ref.generic.general-note-1">1</a></i>: <div id="ref.generic.general-4.sentence-2" class="sentence">Atomic operations or the <span class="texttt">atomic_<span class="shy"></span>ref</span> constructor can acquire
a shared resource, such as a lock associated with the referenced object,
to enable atomic operations to be applied to the referenced object<a class="hidden_link" href="#ref.generic.general-4.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div id="ref.ops" class="section"><h4><a class="secnum" href="#ref.ops" style="min-width:95pt">33.5.7.2</a> Operations <a class="abbr_ref" href="atomics.ref.ops">[atomics.ref.ops]</a></h4><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,required_alignment"><div id="lib:required_alignment,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,required_alignment"><div id="lib:required_alignment,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,required_alignment"><div id="lib:required_alignment,atomic_ref<T*>"><div id="lib:atomic_ref,required_alignment"><div id="lib:required_alignment,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:required_alignment,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="keyword">static</span> <span class="keyword">constexpr</span> size_t required_alignment;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-1"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-1">1</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2905">#</a></div><div class="texpara"><div id="ref.ops-1.sentence-1" class="sentence">The alignment required for an object to be referenced by an atomic reference,
which is at least <span class="texttt"><span class="keyword">alignof</span><span class="parenthesis">(</span>T<span class="parenthesis">)</span></span><a class="hidden_link" href="#ref.ops-1.sentence-1">.</a></div></div></div></div><div class="para nonNormativeOnly" id="ref.ops-2"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-2">2</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2909">#</a></div><div class="texpara"><div id="ref.ops-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#ref.ops-note-1">1</a></i>: <div id="ref.ops-2.sentence-1" class="sentence">Hardware could require an object
referenced by an <span class="texttt">atomic_<span class="shy"></span>ref</span>
to have stricter alignment (<a href="basic.align" title="6.7.6 Alignment">[basic.<span class="shy"></span>align]</a>)
than other objects of type <span class="texttt">T</span><a class="hidden_link" href="#ref.ops-2.sentence-1">.</a></div> <div id="ref.ops-2.sentence-2" class="sentence">Further, whether operations on an <span class="texttt">atomic_<span class="shy"></span>ref</span>
are lock-free could depend on the alignment of the referenced object<a class="hidden_link" href="#ref.ops-2.sentence-2">.</a></div> <div id="ref.ops-2.sentence-3" class="sentence">For example, lock-free operations on <span class="texttt">std<span class="operator">​::​</span>complex<span class="anglebracket">&lt;</span><span class="keyword">double</span><span class="anglebracket">&gt;</span></span>
could be supported only if aligned to <span class="texttt"><span class="literal">2</span><span class="operator">*</span><span class="keyword">alignof</span><span class="parenthesis">(</span><span class="keyword">double</span><span class="parenthesis">)</span></span><a class="hidden_link" href="#ref.ops-2.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic_ref<T*>"><div id="lib:atomic_ref,is_always_lock_free"><div id="lib:is_always_lock_free,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:is_always_lock_free,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-3"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2931">#</a></div><div class="texpara"><div id="ref.ops-3.sentence-1" class="sentence">The static data member <span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span>
if the <span class="texttt">atomic_<span class="shy"></span>ref</span> type's operations are always lock-free,
and <span class="texttt"><span class="literal">false</span></span> otherwise<a class="hidden_link" href="#ref.ops-3.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,is_lock_free"><div id="lib:is_lock_free,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,is_lock_free"><div id="lib:is_lock_free,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,is_lock_free"><div id="lib:is_lock_free,atomic_ref<T*>"><div id="lib:atomic_ref,is_lock_free"><div id="lib:is_lock_free,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:is_lock_free,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-4"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2946">#</a></div><div class="texpara"><div id="ref.ops-4.sentence-1" class="sentence"><i>Returns</i>: <span class="texttt"><span class="literal">true</span></span> if operations on all objects of the type <span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span>
are lock-free,
<span class="texttt"><span class="literal">false</span></span> otherwise<a class="hidden_link" href="#ref.ops-4.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,constructor"><div id="lib:atomic_ref<integral-type>,constructor"><div id="lib:atomic_ref<T*>,constructor"><div id="lib:atomic_ref,constructor"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_ref,constructor">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>atomic_ref<span class="parenthesis">(</span>T<span class="operator">&amp;</span> obj<span class="parenthesis">)</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.ops-5"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2962">#</a></div><div class="texpara"><div id="ref.ops-5.sentence-1" class="sentence"><i>Preconditions</i>: The referenced object is aligned to <span class="texttt">required_<span class="shy"></span>alignment</span><a class="hidden_link" href="#ref.ops-5.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-6"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2966">#</a></div><div class="texpara"><div id="ref.ops-6.sentence-1" class="sentence"><i>Postconditions</i>: <span class="texttt"><span class="operator">*</span><span class="keyword">this</span></span> references <span class="texttt">obj</span><a class="hidden_link" href="#ref.ops-6.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-7"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2970">#</a></div><div class="texpara"><div id="ref.ops-7.sentence-1" class="sentence"><i>Throws</i>: Nothing<a class="hidden_link" href="#ref.ops-7.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,constructor_"><div id="lib:atomic_ref<integral-type>,constructor_"><div id="lib:atomic_ref<T*>,constructor_"><div id="lib:atomic_ref,constructor_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_ref,constructor_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>atomic_ref<span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span> ref<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.ops-8"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2984">#</a></div><div class="texpara"><div id="ref.ops-8.sentence-1" class="sentence"><i>Postconditions</i>: <span class="texttt"><span class="operator">*</span><span class="keyword">this</span></span> references the object referenced by <span class="texttt">ref</span><a class="hidden_link" href="#ref.ops-8.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,store"><div id="lib:store,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,store"><div id="lib:store,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,store"><div id="lib:store,atomic_ref<T*>"><div id="lib:atomic_ref,store"><div id="lib:store,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:store,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>T desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-9"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L2998">#</a></div><div class="texpara"><div id="ref.ops-9.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#ref.ops-9.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-10"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3005">#</a></div><div class="texpara"><div id="ref.ops-10.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
with the value of <span class="texttt">desired</span><a class="hidden_link" href="#ref.ops-10.sentence-1">.</a></div> <div id="ref.ops-10.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#ref.ops-10.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,operator="><div id="lib:operator=,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,operator="><div id="lib:operator=,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,operator="><div id="lib:operator=,atomic_ref<T*>"><div id="lib:atomic_ref,operator="><div id="lib:operator=,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator=,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>T <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T desired<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-11"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3021">#</a></div><div class="texpara"><div id="ref.ops-11.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="codeblock">store<span class="parenthesis">(</span>desired<span class="parenthesis">)</span>;
<span class="keyword">return</span> desired;
</span></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,load"><div id="lib:load,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,load"><div id="lib:load,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,load"><div id="lib:load,atomic_ref<T*>"><div id="lib:atomic_ref,load"><div id="lib:load,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:load,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>T load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-12"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-12">12</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3039">#</a></div><div class="texpara"><div id="ref.ops-12.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#ref.ops-12.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-13"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-13">13</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3047">#</a></div><div class="texpara"><div id="ref.ops-13.sentence-1" class="sentence"><i>Effects</i>: Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#ref.ops-13.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-14"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-14">14</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3051">#</a></div><div class="texpara"><div id="ref.ops-14.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span><a class="hidden_link" href="#ref.ops-14.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,operator_floating-point-type"><div id="lib:operator_floating-point-type,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,operator_integral-type"><div id="lib:operator_integral-type,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,operator_T*"><div id="lib:operator_T*,atomic_ref<T*>"><div id="lib:atomic_ref,operator_type"><div id="lib:operator_type,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator_type,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">operator</span> T<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-15"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-15">15</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3065">#</a></div><div class="texpara"><div id="ref.ops-15.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> load<span class="parenthesis">(</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,exchange"><div id="lib:exchange,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,exchange"><div id="lib:exchange,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,exchange"><div id="lib:exchange,atomic_ref<T*>"><div id="lib:atomic_ref,exchange"><div id="lib:exchange,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:exchange,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>T exchange<span class="parenthesis">(</span>T desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-16"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-16">16</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3079">#</a></div><div class="texpara"><div id="ref.ops-16.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
with <span class="texttt">desired</span><a class="hidden_link" href="#ref.ops-16.sentence-1">.</a></div> <div id="ref.ops-16.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#ref.ops-16.sentence-2">.</a></div> <div id="ref.ops-16.sentence-3" class="sentence">This operation is an atomic read-modify-write operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#ref.ops-16.sentence-3">.</a></div></div></div></div><div class="para" id="ref.ops-17"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-17">17</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3086">#</a></div><div class="texpara"><div id="ref.ops-17.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
immediately before the effects<a class="hidden_link" href="#ref.ops-17.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic_ref<T*>"><div id="lib:atomic_ref,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic_ref"><div id="lib:atomic_ref<floating-point-type>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<integral-type>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic_ref<T*>"><div id="lib:atomic_ref,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic_ref"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_weak,atomic_ref">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                           memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                             memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                           memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                             memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.ops-18"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-18">18</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3115">#</a></div><div class="texpara"><div id="ref.ops-18.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">failure</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#ref.ops-18.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-19"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-19">19</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3123">#</a></div><div class="texpara"><div id="ref.ops-19.sentence-1" class="sentence"><i>Effects</i>: Retrieves the value in <span class="texttt">expected</span><a class="hidden_link" href="#ref.ops-19.sentence-1">.</a></div> <div id="ref.ops-19.sentence-2" class="sentence">It then atomically compares the value representation of
the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span> for equality
with that previously retrieved from <span class="texttt">expected</span>,
and if <span class="texttt"><span class="literal">true</span></span>, replaces the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
with that in <span class="texttt">desired</span><a class="hidden_link" href="#ref.ops-19.sentence-2">.</a></div> <div id="ref.ops-19.sentence-3" class="sentence">If and only if the comparison is <span class="texttt"><span class="literal">true</span></span>,
memory is affected according to the value of <span class="texttt">success</span>, and
if the comparison is <span class="texttt"><span class="literal">false</span></span>,
memory is affected according to the value of <span class="texttt">failure</span><a class="hidden_link" href="#ref.ops-19.sentence-3">.</a></div> <div id="ref.ops-19.sentence-4" class="sentence">When only one <span class="texttt">memory_<span class="shy"></span>order</span> argument is supplied,
the value of <span class="texttt">success</span> is <span class="texttt">order</span>, and
the value of <span class="texttt">failure</span> is <span class="texttt">order</span>
except that a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span> shall be replaced by
the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and
a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span> shall be replaced by
the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span><a class="hidden_link" href="#ref.ops-19.sentence-4">.</a></div> <div id="ref.ops-19.sentence-5" class="sentence">If and only if the comparison is <span class="texttt"><span class="literal">false</span></span> then,
after the atomic operation,
the value in <span class="texttt">expected</span> is replaced by
the value read from the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
during the atomic comparison<a class="hidden_link" href="#ref.ops-19.sentence-5">.</a></div> <div id="ref.ops-19.sentence-6" class="sentence">If the operation returns <span class="texttt"><span class="literal">true</span></span>,
these operations are atomic read-modify-write operations (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)
on the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span><a class="hidden_link" href="#ref.ops-19.sentence-6">.</a></div> <div id="ref.ops-19.sentence-7" class="sentence">Otherwise, these operations are atomic load operations on that memory<a class="hidden_link" href="#ref.ops-19.sentence-7">.</a></div></div></div></div><div class="para" id="ref.ops-20"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-20">20</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3152">#</a></div><div class="texpara"><div id="ref.ops-20.sentence-1" class="sentence"><i>Returns</i>: The result of the comparison<a class="hidden_link" href="#ref.ops-20.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-21"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-21">21</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3156">#</a></div><div class="texpara"><div id="ref.ops-21.sentence-1" class="sentence"><i>Remarks</i>: A weak compare-and-exchange operation may fail spuriously<a class="hidden_link" href="#ref.ops-21.sentence-1">.</a></div> <div id="ref.ops-21.sentence-2" class="sentence">That is, even when the contents of memory referred to
by <span class="texttt">expected</span> and <span class="texttt">ptr</span> are equal,
it may return <span class="texttt"><span class="literal">false</span></span> and
store back to <span class="texttt">expected</span> the same memory contents
that were originally there<a class="hidden_link" href="#ref.ops-21.sentence-2">.</a></div> <div id="ref.ops-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#ref.ops-note-2">2</a></i>: <div id="ref.ops-21.sentence-3" class="sentence">This spurious failure enables implementation of compare-and-exchange
on a broader class of machines, e.g., load-locked store-conditional machines<a class="hidden_link" href="#ref.ops-21.sentence-3">.</a></div> <div id="ref.ops-21.sentence-4" class="sentence">A consequence of spurious failure is
that nearly all uses of weak compare-and-exchange will be in a loop<a class="hidden_link" href="#ref.ops-21.sentence-4">.</a></div> <div id="ref.ops-21.sentence-5" class="sentence">When a compare-and-exchange is in a loop,
the weak version will yield better performance on some platforms<a class="hidden_link" href="#ref.ops-21.sentence-5">.</a></div> <div id="ref.ops-21.sentence-6" class="sentence">When a weak compare-and-exchange would require a loop and
a strong one would not, the strong one is preferable<a class="hidden_link" href="#ref.ops-21.sentence-6">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<T>,wait"><div id="lib:wait,atomic_ref<T>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:wait,atomic_ref%3cT%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>T old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="ref.ops-22"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-22">22</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3182">#</a></div><div class="texpara"><div id="ref.ops-22.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span> <br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#ref.ops-22.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-23"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-23">23</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3190">#</a></div><div class="texpara"><div id="ref.ops-23.sentence-1" class="sentence"><i>Effects</i>: Repeatedly performs the following steps, in order:
<ul class="itemize"><li id="ref.ops-23.1"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#ref.ops-23.1">(23.1)</a></div><div class="texpara"><div id="ref.ops-23.1.sentence-1" class="sentence">Evaluates <span class="texttt">load<span class="parenthesis">(</span>order<span class="parenthesis">)</span></span> and
  compares its value representation for equality against that of <span class="texttt">old</span><a class="hidden_link" href="#ref.ops-23.1.sentence-1">.</a></div></div></li><li id="ref.ops-23.2"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#ref.ops-23.2">(23.2)</a></div><div class="texpara"><div id="ref.ops-23.2.sentence-1" class="sentence">If they compare unequal, returns<a class="hidden_link" href="#ref.ops-23.2.sentence-1">.</a></div></div></li><li id="ref.ops-23.3"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#ref.ops-23.3">(23.3)</a></div><div class="texpara"><div id="ref.ops-23.3.sentence-1" class="sentence">Blocks until it
  is unblocked by an atomic notifying operation or is unblocked spuriously<a class="hidden_link" href="#ref.ops-23.3.sentence-1">.</a></div></div></li></ul></div></div></div></div><div class="para" id="ref.ops-24"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-24">24</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3204">#</a></div><div class="texpara"><div id="ref.ops-24.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic waiting operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)
on atomic object <span class="texttt"><span class="operator">*</span>ptr</span><a class="hidden_link" href="#ref.ops-24.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<T>,notify_one"><div id="lib:notify_one,atomic_ref<T>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_one,atomic_ref%3cT%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="ref.ops-25"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-25">25</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3216">#</a></div><div class="texpara"><div id="ref.ops-25.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of at least one atomic waiting operation on <span class="texttt"><span class="operator">*</span>ptr</span>
that is eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call,
if any such atomic waiting operations exist<a class="hidden_link" href="#ref.ops-25.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-26"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-26">26</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3222">#</a></div><div class="texpara"><div id="ref.ops-26.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)
on atomic object <span class="texttt"><span class="operator">*</span>ptr</span><a class="hidden_link" href="#ref.ops-26.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<T>,notify_all"><div id="lib:notify_all,atomic_ref<T>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_all,atomic_ref%3cT%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="ref.ops-27"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-27">27</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3234">#</a></div><div class="texpara"><div id="ref.ops-27.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of all atomic waiting operations on <span class="texttt"><span class="operator">*</span>ptr</span>
that are eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call<a class="hidden_link" href="#ref.ops-27.sentence-1">.</a></div></div></div></div><div class="para" id="ref.ops-28"><div class="marginalizedparent"><a class="marginalized" href="#ref.ops-28">28</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3239">#</a></div><div class="texpara"><div id="ref.ops-28.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)
 on atomic object <span class="texttt"><span class="operator">*</span>ptr</span><a class="hidden_link" href="#ref.ops-28.sentence-1">.</a></div></div></div></div></div><div id="ref.int" class="section"><h4><a class="secnum" href="#ref.int" style="min-width:95pt">33.5.7.3</a> Specializations for integral types <a class="abbr_ref" href="atomics.ref.int">[atomics.ref.int]</a></h4><div class="para" id="ref.int-1"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3247">#</a></div><div class="texpara"><div id="ref.int-1.sentence-1" class="sentence"><a class="index" id="lib:atomic_ref<integral-type>"></a>There are specializations of the <span class="texttt">atomic_<span class="shy"></span>ref</span> class template
for the integral types
<span class="texttt"><span class="keyword">char</span></span>,
<span class="texttt"><span class="keyword">signed</span> <span class="keyword">char</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">char</span></span>,
<span class="texttt"><span class="keyword">short</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">short</span></span>,
<span class="texttt"><span class="keyword">int</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">int</span></span>,
<span class="texttt"><span class="keyword">long</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">long</span></span>,
<span class="texttt"><span class="keyword">long</span> <span class="keyword">long</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span></span>,
<span id=":char8_t"><span class="texttt"><span class="keyword">char8_<span class="shy"></span>t</span></span></span>,
<span id=":char16_t"><span class="texttt"><span class="keyword">char16_<span class="shy"></span>t</span></span></span>,
<span id=":char32_t"><span class="texttt"><span class="keyword">char32_<span class="shy"></span>t</span></span></span>,
<span id=":wchar_t"><span class="texttt"><span class="keyword">wchar_<span class="shy"></span>t</span></span></span>,
and any other types needed by the typedefs in the header <a href="cstdint.syn#header:%3ccstdint%3e" title="17.4.1 Header <cstdint> synopsis [cstdint.syn]"><span id="headerref:<cstdint>"><span class="texttt">&lt;cstdint&gt;</span></span></a><a class="hidden_link" href="#ref.int-1.sentence-1">.</a></div> <div id="ref.int-1.sentence-2" class="sentence">For each such type <span class="texttt"><i>integral-type</i></span>,
the specialization <span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span><i>integral-type</i><span class="anglebracket">&gt;</span></span> provides
additional atomic operations appropriate to integral types<a class="hidden_link" href="#ref.int-1.sentence-2">.</a></div> <div id="ref.int-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#ref.int-note-1">1</a></i>: <div id="ref.int-1.sentence-3" class="sentence">The specialization <span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span><span class="keyword">bool</span><span class="anglebracket">&gt;</span></span>
uses the primary template (<a href="#ref.generic" title="33.5.7 Class template atomic_­ref">[atomics.<span class="shy"></span>ref.<span class="shy"></span>generic]</a>)<a class="hidden_link" href="#ref.int-1.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div><div class="texpara"><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic_ref<span class="anglebracket">&lt;</span><i>integral-type</i><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
  <span class="keyword">private</span><span class="operator">:</span>
    <i>integral-type</i><span class="operator">*</span> ptr;         <span class="comment">// <i>exposition only</i></span>

  <span class="keyword">public</span><span class="operator">:</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> <i>integral-type</i>;
    <span class="keyword">using</span> difference_type <span class="operator">=</span> value_type;
    <span class="keyword">static</span> <span class="keyword">constexpr</span> size_t required_alignment <span class="operator">=</span> <a class="index" id=":required_alignment_for_atomic_ref_type's_operations_"></a><i>implementation-defined</i>;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_ref_type's_operations_are_always_lock_free_"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">explicit</span> atomic_ref<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span><span class="parenthesis">)</span>;
    <span class="added">constexpr </span>atomic_ref<span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic_ref<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span><i>integral-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> <i>integral-type</i><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><i>integral-type</i> exchange<span class="parenthesis">(</span><i>integral-type</i>,
                           memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><i>integral-type</i> fetch_add<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_sub<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_and<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_or<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_xor<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_max<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_min<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">&amp;</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">|</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">^</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span><i>integral-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div></div><div class="para" id="ref.int-2"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3341">#</a></div><div class="texpara"><div id="ref.int-2.sentence-1" class="sentence">Descriptions are provided below only for members
that differ from the primary template<a class="hidden_link" href="#ref.int-2.sentence-1">.</a></div></div></div><div class="para" id="ref.int-3"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3345">#</a></div><div class="texpara"><div id="ref.int-3.sentence-1" class="sentence">The following operations perform arithmetic computations<a class="hidden_link" href="#ref.int-3.sentence-1">.</a></div> <div id="ref.int-3.sentence-2" class="sentence">The correspondence among key, operator, and computation is specified
in Table <a href="#tab:atomic.types.int.comp" title="Table 148: Atomic arithmetic computations">148</a><a class="hidden_link" href="#ref.int-3.sentence-2">.</a></div></div></div><div class="texpara"><div id="lib:atomic_ref<integral-type>,fetch_xor"><div id="lib:fetch_xor,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,fetch_sub"><div id="lib:fetch_sub,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,fetch_or"><div id="lib:fetch_or,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,fetch_min"><div id="lib:fetch_min,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,fetch_max"><div id="lib:fetch_max,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,fetch_and"><div id="lib:fetch_and,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,fetch_add"><div id="lib:fetch_add,atomic_ref<integral-type>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:fetch_add,atomic_ref%3cintegral-type%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><i>integral-type</i> fetch_<i>key</i><span class="parenthesis">(</span><i>integral-type</i> operand,
  memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.int-4"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3363">#</a></div><div class="texpara"><div id="ref.int-4.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span> with
the result of the computation applied to the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
and the given operand<a class="hidden_link" href="#ref.int-4.sentence-1">.</a></div> <div id="ref.int-4.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#ref.int-4.sentence-2">.</a></div> <div id="ref.int-4.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#ref.int-4.sentence-3">.</a></div></div></div></div><div class="para" id="ref.int-5"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3371">#</a></div><div class="texpara"><div id="ref.int-5.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
immediately before the effects<a class="hidden_link" href="#ref.int-5.sentence-1">.</a></div></div></div></div><div class="para" id="ref.int-6"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3376">#</a></div><div class="texpara"><div id="ref.int-6.sentence-1" class="sentence"><a class="index" id=":signed_integer_representation,two's_complement"></a><i>Remarks</i>: Except for <span class="texttt">fetch_<span class="shy"></span>max</span> and <span class="texttt">fetch_<span class="shy"></span>min</span>, for signed integer types
the result is as if the object value and parameters
were converted to their corresponding unsigned types,
the computation performed on those types, and
the result converted back to the signed type<a class="hidden_link" href="#ref.int-6.sentence-1">.</a></div> <div id="ref.int-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#ref.int-note-2">2</a></i>: <div id="ref.int-6.sentence-2" class="sentence">There are no undefined results arising from the computation<a class="hidden_link" href="#ref.int-6.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="para" id="ref.int-7"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3388">#</a></div><div class="texpara"><div id="ref.int-7.sentence-1" class="sentence">For <span class="texttt">fetch_<span class="shy"></span>max</span> and <span class="texttt">fetch_<span class="shy"></span>min</span>, the maximum and minimum
computation is performed as if by <span class="texttt">max</span> and <span class="texttt">min</span> algorithms
 (<a href="alg.min.max" title="27.8.9 Minimum and maximum">[alg.<span class="shy"></span>min.<span class="shy"></span>max]</a>), respectively, with the object value and the first
parameter as the arguments<a class="hidden_link" href="#ref.int-7.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<integral-type>,operator^="><div id="lib:operator^=,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,operator|="><div id="lib:operator|=,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,operator&amp;="><div id="lib:operator&amp;=,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,operator-="><div id="lib:operator-=,atomic_ref<integral-type>"><div id="lib:atomic_ref<integral-type>,operator+="><div id="lib:operator+=,atomic_ref<integral-type>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator+=,atomic_ref%3cintegral-type%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i> operand<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.int-8"><div class="marginalizedparent"><a class="marginalized" href="#ref.int-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3405">#</a></div><div class="texpara"><div id="ref.int-8.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span><i>key</i><span class="parenthesis">(</span>operand<span class="parenthesis">)</span> <i>op</i> operand;</span></div></div></div></div></div><div id="ref.float" class="section"><h4><a class="secnum" href="#ref.float" style="min-width:95pt">33.5.7.4</a> Specializations for floating-point types <a class="abbr_ref" href="atomics.ref.float">[atomics.ref.float]</a></h4><div class="para" id="ref.float-1"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3413">#</a></div><div class="texpara"><div id="ref.float-1.sentence-1" class="sentence"><a class="index" id="lib:atomic_ref<floating-point-type>"></a>There are specializations of the <span class="texttt">atomic_<span class="shy"></span>ref</span> class template
for all cv-unqualified floating-point types<a class="hidden_link" href="#ref.float-1.sentence-1">.</a></div> <div id="ref.float-1.sentence-2" class="sentence">For each such type <span class="texttt"><i>floating-point-type</i></span>,
the specialization <span class="texttt">atomic_<span class="shy"></span>ref<span class="anglebracket">&lt;</span><i>floating-point</i><span class="anglebracket">&gt;</span></span> provides
additional atomic operations appropriate to floating-point types<a class="hidden_link" href="#ref.float-1.sentence-2">.</a></div></div><div class="texpara"><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic_ref<span class="anglebracket">&lt;</span><i>floating-point-type</i><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
  <span class="keyword">private</span><span class="operator">:</span>
    <i>floating-point-type</i><span class="operator">*</span> ptr;   <span class="comment">// <i>exposition only</i></span>

  <span class="keyword">public</span><span class="operator">:</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> <i>floating-point-type</i>;
    <span class="keyword">using</span> difference_type <span class="operator">=</span> value_type;
    <span class="keyword">static</span> <span class="keyword">constexpr</span> size_t required_alignment <span class="operator">=</span> <a class="index" id=":required_alignment_for_atomic_ref_type's_operations__"></a><i>implementation-defined</i>;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_ref_type's_operations_are_always_lock_free__"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">explicit</span> atomic_ref<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span><span class="parenthesis">)</span>;
    <span class="added">constexpr </span>atomic_ref<span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic_ref<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span><i>floating-point-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> <i>floating-point-type</i><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><i>floating-point-type</i> exchange<span class="parenthesis">(</span><i>floating-point-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><i>floating-point-type</i> fetch_add<span class="parenthesis">(</span><i>floating-point-type</i>,
                                  memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> fetch_sub<span class="parenthesis">(</span><i>floating-point-type</i>,
                                  memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span><i>floating-point-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div></div><div class="para" id="ref.float-2"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3470">#</a></div><div class="texpara"><div id="ref.float-2.sentence-1" class="sentence">Descriptions are provided below only for members
that differ from the primary template<a class="hidden_link" href="#ref.float-2.sentence-1">.</a></div></div></div><div class="para" id="ref.float-3"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3474">#</a></div><div class="texpara"><div id="ref.float-3.sentence-1" class="sentence">The following operations perform arithmetic computations<a class="hidden_link" href="#ref.float-3.sentence-1">.</a></div> <div id="ref.float-3.sentence-2" class="sentence">The correspondence among key, operator, and computation is specified
in Table <a href="#tab:atomic.types.int.comp" title="Table 148: Atomic arithmetic computations">148</a><a class="hidden_link" href="#ref.float-3.sentence-2">.</a></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,fetch_sub"><div id="lib:fetch_sub,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<floating-point-type>,fetch_add"><div id="lib:fetch_add,atomic_ref<floating-point-type>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:fetch_add,atomic_ref%3cfloating-point-type%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><i>floating-point-type</i> fetch_<i>key</i><span class="parenthesis">(</span><i>floating-point-type</i> operand,
                          memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.float-4"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3487">#</a></div><div class="texpara"><div id="ref.float-4.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span> with
the result of the computation applied to the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
and the given operand<a class="hidden_link" href="#ref.float-4.sentence-1">.</a></div> <div id="ref.float-4.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#ref.float-4.sentence-2">.</a></div> <div id="ref.float-4.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#ref.float-4.sentence-3">.</a></div></div></div></div><div class="para" id="ref.float-5"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3495">#</a></div><div class="texpara"><div id="ref.float-5.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
immediately before the effects<a class="hidden_link" href="#ref.float-5.sentence-1">.</a></div></div></div></div><div class="para" id="ref.float-6"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3500">#</a></div><div class="texpara"><div id="ref.float-6.sentence-1" class="sentence"><i>Remarks</i>: If the result is not a representable value for its type (<a href="expr.pre" title="7.1 Preamble">[expr.<span class="shy"></span>pre]</a>),
the result is unspecified,
but the operations otherwise have no undefined behavior<a class="hidden_link" href="#ref.float-6.sentence-1">.</a></div> <div id="ref.float-6.sentence-2" class="sentence">Atomic arithmetic operations on <span class="texttt"><i>floating-point-type</i></span> should conform to
the <span class="texttt">std<span class="operator">​::​</span>numeric_<span class="shy"></span>limits<span class="anglebracket">&lt;</span><i>floating-point-type</i><span class="anglebracket">&gt;</span></span> traits
associated with the floating-point type (<a href="limits.syn" title="17.3.3 Header <limits> synopsis">[limits.<span class="shy"></span>syn]</a>)<a class="hidden_link" href="#ref.float-6.sentence-2">.</a></div> <div id="ref.float-6.sentence-3" class="sentence">The floating-point environment (<a href="cfenv" title="28.3 The floating-point environment">[cfenv]</a>)
for atomic arithmetic operations on <span class="texttt"><i>floating-point-type</i></span>
may be different than the calling thread's floating-point environment<a class="hidden_link" href="#ref.float-6.sentence-3">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<floating-point-type>,operator-="><div id="lib:operator-=,atomic_ref<floating-point-type>"><div id="lib:atomic_ref<floating-point-type>,operator+="><div id="lib:operator+=,atomic_ref<floating-point-type>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator+=,atomic_ref%3cfloating-point-type%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i> operand<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.float-7"><div class="marginalizedparent"><a class="marginalized" href="#ref.float-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3520">#</a></div><div class="texpara"><div id="ref.float-7.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span><i>key</i><span class="parenthesis">(</span>operand<span class="parenthesis">)</span> <i>op</i> operand;</span></div></div></div></div></div><div id="ref.pointer" class="section"><h4><a class="secnum" href="#ref.pointer" style="min-width:95pt">33.5.7.5</a> Partial specialization for pointers <a class="abbr_ref" href="atomics.ref.pointer">[atomics.ref.pointer]</a></h4><div class="texpara"><a class="index" id="lib:atomic_ref<T*>"></a>
<span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic_ref<span class="anglebracket">&lt;</span>T<span class="operator">*</span><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
  <span class="keyword">private</span><span class="operator">:</span>
    T<span class="operator">*</span><span class="operator">*</span> ptr;        <span class="comment">// <i>exposition only</i></span>

  <span class="keyword">public</span><span class="operator">:</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> T<span class="operator">*</span>;
    <span class="keyword">using</span> difference_type <span class="operator">=</span> ptrdiff_t;
    <span class="keyword">static</span> <span class="keyword">constexpr</span> size_t required_alignment <span class="operator">=</span> <a class="index" id=":required_alignment_for_atomic_ref_type's_operations___"></a><i>implementation-defined</i>;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_ref_type's_operations_are_always_lock_free___"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">explicit</span> atomic_ref<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span><span class="parenthesis">)</span>;
    <span class="added">constexpr </span>atomic_ref<span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic_ref<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic_ref<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> T<span class="operator">*</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span>T<span class="operator">*</span> exchange<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_add<span class="parenthesis">(</span>difference_type, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_sub<span class="parenthesis">(</span>difference_type, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_max<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_min<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span>difference_type<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span>difference_type<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div><div class="para" id="ref.pointer-1"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3581">#</a></div><div class="texpara"><div id="ref.pointer-1.sentence-1" class="sentence">Descriptions are provided below only for members
that differ from the primary template<a class="hidden_link" href="#ref.pointer-1.sentence-1">.</a></div></div></div><div class="para" id="ref.pointer-2"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3585">#</a></div><div class="texpara"><div id="ref.pointer-2.sentence-1" class="sentence">The following operations perform arithmetic computations<a class="hidden_link" href="#ref.pointer-2.sentence-1">.</a></div> <div id="ref.pointer-2.sentence-2" class="sentence">The correspondence among key, operator, and computation is specified
in Table <a href="#tab:atomic.types.pointer.comp" title="Table 149: Atomic pointer computations">149</a><a class="hidden_link" href="#ref.pointer-2.sentence-2">.</a></div></div></div><div class="texpara"><div id="lib:atomic_ref<T*>,fetch_min"><div id="lib:fetch_min,atomic_ref<T*>"><div id="lib:atomic_ref<T*>,fetch_max"><div id="lib:fetch_max,atomic_ref<T*>"><div id="lib:atomic_ref<T*>,fetch_sub"><div id="lib:fetch_sub,atomic_ref<T*>"><div id="lib:atomic_ref<T*>,fetch_add"><div id="lib:fetch_add,atomic_ref<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:fetch_add,atomic_ref%3cT*%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>T<span class="operator">*</span> fetch_<i>key</i><span class="parenthesis">(</span>difference_type operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="ref.pointer-3"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3599">#</a></div><div class="texpara"><div id="ref.pointer-3.sentence-1" class="sentence"><i>Mandates</i>: <span class="texttt">T</span> is a complete object type<a class="hidden_link" href="#ref.pointer-3.sentence-1">.</a></div></div></div></div><div class="para" id="ref.pointer-4"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3603">#</a></div><div class="texpara"><div id="ref.pointer-4.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span> with
the result of the computation applied to the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
and the given operand<a class="hidden_link" href="#ref.pointer-4.sentence-1">.</a></div> <div id="ref.pointer-4.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#ref.pointer-4.sentence-2">.</a></div> <div id="ref.pointer-4.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#ref.pointer-4.sentence-3">.</a></div></div></div></div><div class="para" id="ref.pointer-5"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3611">#</a></div><div class="texpara"><div id="ref.pointer-5.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value referenced by <span class="texttt"><span class="operator">*</span>ptr</span>
immediately before the effects<a class="hidden_link" href="#ref.pointer-5.sentence-1">.</a></div></div></div></div><div class="para" id="ref.pointer-6"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3616">#</a></div><div class="texpara"><div id="ref.pointer-6.sentence-1" class="sentence"><i>Remarks</i>: The result may be an undefined address,
but the operations otherwise have no undefined behavior<a class="hidden_link" href="#ref.pointer-6.sentence-1">.</a></div></div></div></div><div class="para" id="ref.pointer-7"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3621">#</a></div><div class="texpara"><div id="ref.pointer-7.sentence-1" class="sentence">For <span class="texttt">fetch_<span class="shy"></span>max</span> and <span class="texttt">fetch_<span class="shy"></span>min</span>, the maximum and minimum
computation is performed as if by <span class="texttt">max</span> and <span class="texttt">min</span>
algorithms (<a href="alg.min.max" title="27.8.9 Minimum and maximum">[alg.<span class="shy"></span>min.<span class="shy"></span>max]</a>), respectively, with the object value and the first
parameter as the arguments<a class="hidden_link" href="#ref.pointer-7.sentence-1">.</a></div></div><div class="texpara"><div id="ref.pointer-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#ref.pointer-note-1">1</a></i>: <div id="ref.pointer-7.sentence-2" class="sentence">If the pointers point to different complete objects (or subobjects thereof),
the <span class="texttt"><span class="anglebracket">&lt;</span></span> operator does not establish a strict weak ordering
(Table <a href="utility.arg.requirements#tab:cpp17.lessthancomparable" title="Table 29: Cpp17LessThanComparable requirements">29</a>, <a href="expr.rel" title="7.6.9 Relational operators">[expr.<span class="shy"></span>rel]</a>)<a class="hidden_link" href="#ref.pointer-7.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<T*>,operator-="><div id="lib:operator-=,atomic_ref<T*>"><div id="lib:atomic_ref<T*>,operator+="><div id="lib:operator+=,atomic_ref<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator+=,atomic_ref%3cT*%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>difference_type operand<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.pointer-8"><div class="marginalizedparent"><a class="marginalized" href="#ref.pointer-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3643">#</a></div><div class="texpara"><div id="ref.pointer-8.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span><i>key</i><span class="parenthesis">(</span>operand<span class="parenthesis">)</span> <i>op</i> operand;</span></div></div></div></div></div><div id="ref.memop" class="section"><h4><a class="secnum" href="#ref.memop" style="min-width:95pt">33.5.7.6</a> Member operators
                          common to integers and pointers to objects <a class="abbr_ref" href="atomics.ref.memop">[atomics.ref.memop]</a></h4><div class="texpara"><div id="lib:atomic_ref<integral-type>,operator++"><div id="lib:operator++,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,operator++"><div id="lib:operator++,atomic_ref<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator++,atomic_ref%3cT*%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.memop-1"><div class="marginalizedparent"><a class="marginalized" href="#ref.memop-1">1</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3659">#</a></div><div class="texpara"><div id="ref.memop-1.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>add<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<integral-type>,operator--"><div id="lib:operator--,atomic_ref<integral-type>"><div id="lib:atomic_ref<T*>,operator--"><div id="lib:operator--,atomic_ref<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator--,atomic_ref%3cT*%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.memop-2"><div class="marginalizedparent"><a class="marginalized" href="#ref.memop-2">2</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3671">#</a></div><div class="texpara"><div id="ref.memop-2.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>sub<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<integral-type>,operator++_"><div id="lib:operator++,atomic_ref<integral-type>_"><div id="lib:atomic_ref<T*>,operator++_"><div id="lib:operator++,atomic_ref<T*>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator++,atomic_ref%3cT*%3e_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.memop-3"><div class="marginalizedparent"><a class="marginalized" href="#ref.memop-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3683">#</a></div><div class="texpara"><div id="ref.memop-3.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>add<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span> <span class="operator">+</span> <span class="literal">1</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic_ref<integral-type>,operator--_"><div id="lib:operator--,atomic_ref<integral-type>_"><div id="lib:atomic_ref<T*>,operator--_"><div id="lib:operator--,atomic_ref<T*>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator--,atomic_ref%3cT*%3e_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="ref.memop-4"><div class="marginalizedparent"><a class="marginalized" href="#ref.memop-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3695">#</a></div><div class="texpara"><div id="ref.memop-4.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>sub<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span> <span class="operator">-</span> <span class="literal">1</span>;</span></div></div></div></div></div></div>
<div id="types.generic" class="section"><h3><a class="secnum" href="#types.generic" style="min-width:80pt">33.5.8</a> Class template <span class="texttt">atomic</span> <a class="abbr_ref" href="atomics.types.generic">[atomics.types.generic]</a></h3><div id="types.generic.general" class="section"><h4><a class="secnum" href="#types.generic.general" style="min-width:95pt">33.5.8.1</a> General <a class="abbr_ref" href="atomics.types.generic.general">[atomics.types.generic.general]</a></h4><div class="texpara"><span id="lib:atomic,value_type"><span id="lib:value_type,atomic"><span id="lib:atomic"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic">🔗</a></div><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic <span class="curlybracket">{</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> T;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="comment">// <a href="#types.operations" title="33.5.8.2 Operations on atomic types">[atomics.<span class="shy"></span>types.<span class="shy"></span>operations]</a>, operations on atomic types</span>
    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span><span class="parenthesis">(</span>is_nothrow_default_constructible_v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="parenthesis">)</span>;
    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span>T<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    T load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">operator</span> T<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> T<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> store<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    T exchange<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T exchange<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span>, T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="keyword">void</span> wait<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>T, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></span></span></span><a class="index" id="lib:atomic_"></a></div><div class="para" id="types.generic.general-1"><div class="marginalizedparent"><a class="marginalized" href="#types.generic.general-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3753">#</a></div><div class="texpara"><div id="types.generic.general-1.sentence-1" class="sentence">The template argument for <span class="texttt">T</span> shall meet the
<i>Cpp17CopyConstructible</i> and <i>Cpp17CopyAssignable</i> requirements<a class="hidden_link" href="#types.generic.general-1.sentence-1">.</a></div> <div id="types.generic.general-1.sentence-2" class="sentence">The program is ill-formed if any of
<ul class="itemize"><li id="types.generic.general-1.1"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#types.generic.general-1.1">(1.1)</a></div><span class="texttt">is_<span class="shy"></span>trivially_<span class="shy"></span>copyable_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span>,</li><li id="types.generic.general-1.2"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#types.generic.general-1.2">(1.2)</a></div><span class="texttt">is_<span class="shy"></span>copy_<span class="shy"></span>constructible_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span>,</li><li id="types.generic.general-1.3"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#types.generic.general-1.3">(1.3)</a></div><span class="texttt">is_<span class="shy"></span>move_<span class="shy"></span>constructible_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span>,</li><li id="types.generic.general-1.4"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#types.generic.general-1.4">(1.4)</a></div><span class="texttt">is_<span class="shy"></span>copy_<span class="shy"></span>assignable_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span>, or</li><li id="types.generic.general-1.5"><div class="marginalizedparent" style="left:-27mm"><a class="marginalized" href="#types.generic.general-1.5">(1.5)</a></div><span class="texttt">is_<span class="shy"></span>move_<span class="shy"></span>assignable_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span></li></ul>
is <span class="texttt"><span class="literal">false</span></span><a class="hidden_link" href="#types.generic.general-1.sentence-2">.</a></div> <div id="types.generic.general-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.generic.general-note-1">1</a></i>: <div id="types.generic.general-1.sentence-3" class="sentence">Type arguments that are
not also statically initializable can be difficult to use<a class="hidden_link" href="#types.generic.general-1.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para" id="types.generic.general-2"><div class="marginalizedparent"><a class="marginalized" href="#types.generic.general-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3770">#</a></div><div class="texpara"><div id="types.generic.general-2.sentence-1" class="sentence">The specialization <span class="texttt">atomic<span class="anglebracket">&lt;</span><span class="keyword">bool</span><span class="anglebracket">&gt;</span></span> is a standard-layout struct<a class="hidden_link" href="#types.generic.general-2.sentence-1">.</a></div> <div id="types.generic.general-2.sentence-2" class="sentence">It has a trivial destructor<a class="hidden_link" href="#types.generic.general-2.sentence-2">.</a></div></div></div><div class="para nonNormativeOnly" id="types.generic.general-3"><div class="marginalizedparent"><a class="marginalized" href="#types.generic.general-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3774">#</a></div><div class="texpara"><div id="types.generic.general-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.generic.general-note-2">2</a></i>: <div id="types.generic.general-3.sentence-1" class="sentence">The representation of an atomic specialization
need not have the same size and alignment requirement as
its corresponding argument type<a class="hidden_link" href="#types.generic.general-3.sentence-1">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div id="types.operations" class="section"><h4><a class="secnum" href="#types.operations" style="min-width:95pt">33.5.8.2</a> Operations on atomic types <a class="abbr_ref" href="atomics.types.operations">[atomics.types.operations]</a></h4><div class="texpara"><div id="lib:atomic<floating-point-type>,constructor"><div id="lib:atomic<integral-type>,constructor"><div id="lib:atomic<T*>,constructor"><div id="lib:atomic,constructor"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic,constructor">🔗</a></div><code class="itemdeclcode"><span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span><span class="parenthesis">(</span>is_nothrow_default_constructible_v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="parenthesis">)</span>;
</code></div></div></div></div></div></div><div class="para" id="types.operations-1"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-1">1</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3792">#</a></div><div class="texpara"><div id="types.operations-1.sentence-1" class="sentence"><i>Mandates</i>: <span class="texttt">is_<span class="shy"></span>default_<span class="shy"></span>constructible_<span class="shy"></span>v<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-1.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-2"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-2">2</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3796">#</a></div><div class="texpara"><div id="types.operations-2.sentence-1" class="sentence"><i>Effects</i>: Initializes the atomic object with the value of <span class="texttt">T<span class="parenthesis">(</span><span class="parenthesis">)</span></span><a class="hidden_link" href="#types.operations-2.sentence-1">.</a></div> <div id="types.operations-2.sentence-2" class="sentence">Initialization is not an atomic operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#types.operations-2.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,constructor_"><div id="lib:atomic<integral-type>,constructor_"><div id="lib:atomic<T*>,constructor_"><div id="lib:atomic,constructor_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic,constructor_">🔗</a></div><code class="itemdeclcode"><span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span>T desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="types.operations-3"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3811">#</a></div><div class="texpara"><div id="types.operations-3.sentence-1" class="sentence"><i>Effects</i>: Initializes the object with the value <span class="texttt">desired</span><a class="hidden_link" href="#types.operations-3.sentence-1">.</a></div> <div id="types.operations-3.sentence-2" class="sentence">Initialization is not an atomic operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#types.operations-3.sentence-2">.</a></div> <div id="types.operations-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-1">1</a></i>: <div id="types.operations-3.sentence-3" class="sentence">It is possible to have an access to an atomic object <span class="texttt">A</span>
race with its construction, for example by communicating the address of the
just-constructed object <span class="texttt">A</span> to another thread via
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span> operations on a suitable atomic pointer
variable, and then immediately accessing <span class="texttt">A</span> in the receiving thread<a class="hidden_link" href="#types.operations-3.sentence-3">.</a></div> <div id="types.operations-3.sentence-4" class="sentence">This results in undefined behavior<a class="hidden_link" href="#types.operations-3.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic<weak_ptr<T>>"><div id="lib:atomic<shared_ptr<T>>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic<shared_ptr<T>>"><div id="lib:atomic<floating-point-type>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic<integral-type>"><div id="lib:atomic<T*>,is_always_lock_free"><div id="lib:is_always_lock_free,atomic<T*>"><div id="lib:atomic,is_always_lock_free"><div id="lib:is_always_lock_free,atomic"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:is_always_lock_free,atomic">🔗</a></div><code class="itemdeclcode"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free_"></a><i>implementation-defined</i>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-4"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3836">#</a></div><div class="texpara"><div id="types.operations-4.sentence-1" class="sentence">The <span id=":static"><span class="texttt"><span class="keyword">static</span></span></span> data member <span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span>
if the atomic type's operations are always lock-free, and <span class="texttt"><span class="literal">false</span></span> otherwise<a class="hidden_link" href="#types.operations-4.sentence-1">.</a></div> <div id="types.operations-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-2">2</a></i>: <div id="types.operations-4.sentence-2" class="sentence">The value of <span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is consistent with the value of
the corresponding <span class="texttt">ATOMIC_<span class="shy"></span><span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>_<span class="shy"></span>LOCK_<span class="shy"></span>FREE</span> macro, if defined<a class="hidden_link" href="#types.operations-4.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,is_lock_free"><div id="lib:is_lock_free,atomic<weak_ptr<T>>"><div id="lib:atomic<shared_ptr<T>>,is_lock_free"><div id="lib:is_lock_free,atomic<shared_ptr<T>>"><div id="lib:atomic<floating-point-type>,is_lock_free"><div id="lib:is_lock_free,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,is_lock_free"><div id="lib:is_lock_free,atomic<integral-type>"><div id="lib:atomic<T*>,is_lock_free"><div id="lib:is_lock_free,atomic<T*>"><div id="lib:atomic,is_lock_free"><div id="lib:is_lock_free,atomic"><div id="lib:atomic_is_lock_free"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_is_lock_free">🔗</a></div><code class="itemdeclcode"><span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-5"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3858">#</a></div><div class="texpara"><div id="types.operations-5.sentence-1" class="sentence"><i>Returns</i>: <span class="texttt"><span class="literal">true</span></span> if the object's operations are lock-free, <span class="texttt"><span class="literal">false</span></span> otherwise<a class="hidden_link" href="#types.operations-5.sentence-1">.</a></div> <div id="types.operations-note-3" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-3">3</a></i>: <div id="types.operations-5.sentence-2" class="sentence">The return value of the <span class="texttt">is_<span class="shy"></span>lock_<span class="shy"></span>free</span> member function
is consistent with the value of <span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> for the same type<a class="hidden_link" href="#types.operations-5.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,store"><div id="lib:store,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,store"><div id="lib:store,atomic<integral-type>"><div id="lib:atomic<T*>,store"><div id="lib:store,atomic<T*>"><div id="lib:atomic,store"><div id="lib:store,atomic"><div id="lib:atomic_store_explicit"><div id="lib:atomic_store"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_store">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> store<span class="parenthesis">(</span>T desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>T desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-6"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3879">#</a></div><div class="texpara"><div id="types.operations-6.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-6.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-7"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3884">#</a></div><div class="texpara"><div id="types.operations-7.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#types.operations-7.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-8"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3891">#</a></div><div class="texpara"><div id="types.operations-8.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by <span id=":this"><span class="texttt"><span class="keyword">this</span></span></span>
with the value of <span class="texttt">desired</span><a class="hidden_link" href="#types.operations-8.sentence-1">.</a></div> <div id="types.operations-8.sentence-2" class="sentence">Memory is affected according to the value of
<span class="texttt">order</span><a class="hidden_link" href="#types.operations-8.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,operator="><div id="lib:operator=,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,operator="><div id="lib:operator=,atomic<integral-type>"><div id="lib:atomic<T*>,operator="><div id="lib:operator=,atomic<T*>"><div id="lib:atomic,operator="><div id="lib:operator=,atomic"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator=,atomic">🔗</a></div><code class="itemdeclcode">T <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T desired<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-9"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3908">#</a></div><div class="texpara"><div id="types.operations-9.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-9.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-10"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3913">#</a></div><div class="texpara"><div id="types.operations-10.sentence-1" class="sentence"><i>Effects</i>: Equivalent to <span class="texttt">store<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#types.operations-10.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-11"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3917">#</a></div><div class="texpara"><div id="types.operations-11.sentence-1" class="sentence"><i>Returns</i>: <span class="texttt">desired</span><a class="hidden_link" href="#types.operations-11.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,load"><div id="lib:load,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,load"><div id="lib:load,atomic<integral-type>"><div id="lib:atomic<T*>,load"><div id="lib:load,atomic<T*>"><div id="lib:atomic,load"><div id="lib:load,atomic"><div id="lib:atomic_load_explicit"><div id="lib:atomic_load"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_load">🔗</a></div><code class="itemdeclcode">T load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-12"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-12">12</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3934">#</a></div><div class="texpara"><div id="types.operations-12.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-12.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-13"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-13">13</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3939">#</a></div><div class="texpara"><div id="types.operations-13.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#types.operations-13.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-14"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-14">14</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3947">#</a></div><div class="texpara"><div id="types.operations-14.sentence-1" class="sentence"><i>Effects</i>: Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#types.operations-14.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-15"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-15">15</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3951">#</a></div><div class="texpara"><div id="types.operations-15.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value pointed to by <span id=":this_"><span class="texttt"><span class="keyword">this</span></span></span><a class="hidden_link" href="#types.operations-15.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,operator_floating-point-type"><div id="lib:operator_floating-point-type,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,operator_integral-type"><div id="lib:operator_integral-type,atomic<integral-type>"><div id="lib:atomic<T*>,operator_T*"><div id="lib:operator_T*,atomic<T*>"><div id="lib:atomic,operator_type"><div id="lib:operator_type,atomic"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator_type,atomic">🔗</a></div><code class="itemdeclcode"><span class="keyword">operator</span> T<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">operator</span> T<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-16"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-16">16</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3966">#</a></div><div class="texpara"><div id="types.operations-16.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-16.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-17"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-17">17</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3971">#</a></div><div class="texpara"><div id="types.operations-17.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> load<span class="parenthesis">(</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,exchange"><div id="lib:exchange,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,exchange"><div id="lib:exchange,atomic<integral-type>"><div id="lib:atomic<T*>,exchange"><div id="lib:exchange,atomic<T*>"><div id="lib:atomic,exchange"><div id="lib:exchange,atomic"><div id="lib:atomic_exchange_explicit"><div id="lib:atomic_exchange"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_exchange">🔗</a></div><code class="itemdeclcode">T exchange<span class="parenthesis">(</span>T desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T exchange<span class="parenthesis">(</span>T desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-18"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-18">18</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3989">#</a></div><div class="texpara"><div id="types.operations-18.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-18.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-19"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-19">19</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L3994">#</a></div><div class="texpara"><div id="types.operations-19.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by <span id=":this__"><span class="texttt"><span class="keyword">this</span></span></span>
with <span class="texttt">desired</span><a class="hidden_link" href="#types.operations-19.sentence-1">.</a></div> <div id="types.operations-19.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#types.operations-19.sentence-2">.</a></div> <div id="types.operations-19.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#types.operations-19.sentence-3">.</a></div></div></div></div><div class="para" id="types.operations-20"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-20">20</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4001">#</a></div><div class="texpara"><div id="types.operations-20.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value pointed to by <span id=":this___"><span class="texttt"><span class="keyword">this</span></span></span> immediately before the effects<a class="hidden_link" href="#types.operations-20.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic<integral-type>"><div id="lib:atomic<T*>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic<T*>"><div id="lib:atomic,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic"><div id="lib:atomic<floating-point-type>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic<integral-type>"><div id="lib:atomic<T*>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic<T*>"><div id="lib:atomic,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic"><div id="lib:atomic_compare_exchange_strong_explicit"><div id="lib:atomic_compare_exchange_weak_explicit"><div id="lib:atomic_compare_exchange_strong"><div id="lib:atomic_compare_exchange_weak"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_compare_exchange_weak">🔗</a></div><code class="itemdeclcode"><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                           memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                           memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                             memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                             memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                           memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                           memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                             memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">&amp;</span> expected, T desired,
                             memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-21"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-21">21</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4038">#</a></div><div class="texpara"><div id="types.operations-21.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.operations-21.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-22"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-22">22</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4043">#</a></div><div class="texpara"><div id="types.operations-22.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">failure</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#types.operations-22.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-23"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-23">23</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4051">#</a></div><div class="texpara"><div id="types.operations-23.sentence-1" class="sentence"><i>Effects</i>: Retrieves the value in <span class="texttt">expected</span><a class="hidden_link" href="#types.operations-23.sentence-1">.</a></div> <div id="types.operations-23.sentence-2" class="sentence">It then atomically
compares the value representation of the value pointed to by <span id=":this____"><span class="texttt"><span class="keyword">this</span></span></span>
for equality with that previously retrieved from <span class="texttt">expected</span>,
and if true, replaces the value pointed to
by <span id=":this_____"><span class="texttt"><span class="keyword">this</span></span></span> with that in <span class="texttt">desired</span><a class="hidden_link" href="#types.operations-23.sentence-2">.</a></div> <div id="types.operations-23.sentence-3" class="sentence">If and only if the comparison is <span class="texttt"><span class="literal">true</span></span>, memory is affected according to the
value of <span class="texttt">success</span>, and if the comparison is false, memory is affected according
to the value of <span class="texttt">failure</span><a class="hidden_link" href="#types.operations-23.sentence-3">.</a></div> <div id="types.operations-23.sentence-4" class="sentence">When only one <span class="texttt">memory_<span class="shy"></span>order</span> argument is
supplied, the value of <span class="texttt">success</span> is <span class="texttt">order</span>, and the value of
<span class="texttt">failure</span> is <span class="texttt">order</span> except that a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and a value of
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span> shall be replaced by the value
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span><a class="hidden_link" href="#types.operations-23.sentence-4">.</a></div> <div id="types.operations-23.sentence-5" class="sentence">If and only if the comparison is false then, after the atomic operation,
the value in <span class="texttt">expected</span> is replaced by the value
pointed to by <span id=":this______"><span class="texttt"><span class="keyword">this</span></span></span> during the atomic comparison<a class="hidden_link" href="#types.operations-23.sentence-5">.</a></div> <div id="types.operations-23.sentence-6" class="sentence">If the operation returns <span class="texttt"><span class="literal">true</span></span>, these
operations are atomic read-modify-write
operations (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>) on the memory
pointed to by <span id=":this_______"><span class="texttt"><span class="keyword">this</span></span></span><a class="hidden_link" href="#types.operations-23.sentence-6">.</a></div> <div id="types.operations-23.sentence-7" class="sentence">Otherwise, these operations are atomic load operations on that memory<a class="hidden_link" href="#types.operations-23.sentence-7">.</a></div></div></div></div><div class="para" id="types.operations-24"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-24">24</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4075">#</a></div><div class="texpara"><div id="types.operations-24.sentence-1" class="sentence"><i>Returns</i>: The result of the comparison<a class="hidden_link" href="#types.operations-24.sentence-1">.</a></div></div></div></div><div class="para nonNormativeOnly" id="types.operations-25"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-25">25</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4079">#</a></div><div class="texpara"><div id="types.operations-note-4" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-4">4</a></i>: <div id="types.operations-25.sentence-1" class="sentence">For example, the effect of
<span class="texttt">compare_<span class="shy"></span>exchange_<span class="shy"></span>strong</span>
on objects without padding bits (<a href="basic.types.general#term.padding.bits" title="6.8.1 General">[basic.<span class="shy"></span>types.<span class="shy"></span>general]</a>) is
<span class="codeblock"><span class="keyword">if</span> <span class="parenthesis">(</span>memcmp<span class="parenthesis">(</span><span class="keyword">this</span>, <span class="operator">&amp;</span>expected, <span class="keyword">sizeof</span><span class="parenthesis">(</span><span class="operator">*</span><span class="keyword">this</span><span class="parenthesis">)</span><span class="parenthesis">)</span> <span class="operator">=</span><span class="operator">=</span> <span class="literal">0</span><span class="parenthesis">)</span>
  memcpy<span class="parenthesis">(</span><span class="keyword">this</span>, <span class="operator">&amp;</span>desired, <span class="keyword">sizeof</span><span class="parenthesis">(</span><span class="operator">*</span><span class="keyword">this</span><span class="parenthesis">)</span><span class="parenthesis">)</span>;
<span class="keyword">else</span>
  memcpy<span class="parenthesis">(</span><span class="operator">&amp;</span>expected, <span class="keyword">this</span>, <span class="keyword">sizeof</span><span class="parenthesis">(</span><span class="operator">*</span><span class="keyword">this</span><span class="parenthesis">)</span><span class="parenthesis">)</span>;
</span></div> —&nbsp;<i>end note</i>]</div></div> <div id="types.operations-example-1" class="example"><div class="texpara">[<i>Example&nbsp;<a href="#types.operations-example-1">1</a></i>: <div id="types.operations-25.sentence-2" class="sentence">The expected use of the compare-and-exchange operations is as follows<a class="hidden_link" href="#types.operations-25.sentence-2">.</a></div> <div id="types.operations-25.sentence-3" class="sentence">The
compare-and-exchange operations will update <span class="texttt">expected</span> when another iteration of
the loop is needed<a class="hidden_link" href="#types.operations-25.sentence-3">.</a></div> <span class="codeblock">expected <span class="operator">=</span> current<span class="operator">.</span>load<span class="parenthesis">(</span><span class="parenthesis">)</span>;
<span class="keyword">do</span> <span class="curlybracket">{</span>
  desired <span class="operator">=</span> function<span class="parenthesis">(</span>expected<span class="parenthesis">)</span>;
<span class="curlybracket">}</span> <span class="keyword">while</span> <span class="parenthesis">(</span><span class="operator">!</span>current<span class="operator">.</span>compare_exchange_weak<span class="parenthesis">(</span>expected, desired<span class="parenthesis">)</span><span class="parenthesis">)</span>;
</span> —&nbsp;<i>end example</i>]</div></div> <div id="types.operations-example-2" class="example"><div class="texpara">[<i>Example&nbsp;<a href="#types.operations-example-2">2</a></i>: <div id="types.operations-25.sentence-4" class="sentence">Because the expected value is updated only on failure,
code releasing the memory containing the <span class="texttt">expected</span> value on success will work<a class="hidden_link" href="#types.operations-25.sentence-4">.</a></div> <div id="types.operations-25.sentence-5" class="sentence">For example, list head insertion will act atomically and would not introduce a
data race in the following code:
<span class="codeblock"><span class="keyword">do</span> <span class="curlybracket">{</span>
  p<span class="operator">-</span><span class="anglebracket">&gt;</span>next <span class="operator">=</span> head;                                   <span class="comment">// make new list node point to the current head</span>
<span class="curlybracket">}</span> <span class="keyword">while</span> <span class="parenthesis">(</span><span class="operator">!</span>head<span class="operator">.</span>compare_exchange_weak<span class="parenthesis">(</span>p<span class="operator">-</span><span class="anglebracket">&gt;</span>next, p<span class="parenthesis">)</span><span class="parenthesis">)</span>;  <span class="comment">// try to insert</span>
</span></div> —&nbsp;<i>end example</i>]</div></div></div></div></div><div class="para" id="types.operations-26"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-26">26</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4114">#</a></div><div class="texpara"><div id="types.operations-26.sentence-1" class="sentence">Implementations should ensure that weak compare-and-exchange operations do not
consistently return <span class="texttt"><span class="literal">false</span></span> unless either the atomic object has value
different from <span class="texttt">expected</span> or there are concurrent modifications to the
atomic object<a class="hidden_link" href="#types.operations-26.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-27"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-27">27</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4120">#</a></div><div class="texpara"><div id="types.operations-27.sentence-1" class="sentence"><i>Remarks</i>: A weak compare-and-exchange operation may fail spuriously<a class="hidden_link" href="#types.operations-27.sentence-1">.</a></div> <div id="types.operations-27.sentence-2" class="sentence">That is, even when
the contents of memory referred to by <span class="texttt">expected</span> and <span id=":this________"><span class="texttt"><span class="keyword">this</span></span></span> are
equal, it may return <span class="texttt"><span class="literal">false</span></span> and store back to <span class="texttt">expected</span> the same memory
contents that were originally there<a class="hidden_link" href="#types.operations-27.sentence-2">.</a></div> <div id="types.operations-note-5" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-5">5</a></i>: <div id="types.operations-27.sentence-3" class="sentence">This
spurious failure enables implementation of compare-and-exchange on a broader class of
machines, e.g., load-locked store-conditional machines<a class="hidden_link" href="#types.operations-27.sentence-3">.</a></div> <div id="types.operations-27.sentence-4" class="sentence">A
consequence of spurious failure is that nearly all uses of weak compare-and-exchange
will be in a loop<a class="hidden_link" href="#types.operations-27.sentence-4">.</a></div> <div id="types.operations-27.sentence-5" class="sentence">When a compare-and-exchange is in a loop, the weak version will yield better performance
on some platforms<a class="hidden_link" href="#types.operations-27.sentence-5">.</a></div> <div id="types.operations-27.sentence-6" class="sentence">When a weak compare-and-exchange would require a loop and a strong one
would not, the strong one is preferable<a class="hidden_link" href="#types.operations-27.sentence-6">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="para nonNormativeOnly" id="types.operations-28"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-28">28</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4137">#</a></div><div class="texpara"><div id="types.operations-note-6" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-6">6</a></i>: <div id="types.operations-28.sentence-1" class="sentence">Under cases where the <span class="texttt">memcpy</span> and <span class="texttt">memcmp</span> semantics of the compare-and-exchange
operations apply, the comparisons can fail for values that compare equal with
<span class="texttt"><span class="keyword">operator</span><span class="operator">=</span><span class="operator">=</span></span> if the value representation has trap bits or alternate
representations of the same value<a class="hidden_link" href="#types.operations-28.sentence-1">.</a></div> <div id="types.operations-28.sentence-2" class="sentence">Notably, on implementations conforming to
ISO/IEC/IEEE 60559, floating-point <span class="texttt"><span class="operator">-</span><span class="literal">0.0</span></span> and <span class="texttt"><span class="operator">+</span><span class="literal">0.0</span></span>
will not compare equal with <span class="texttt">memcmp</span> but will compare equal with <span class="texttt"><span class="keyword">operator</span><span class="operator">=</span><span class="operator">=</span></span>,
and NaNs with the same payload will compare equal with <span class="texttt">memcmp</span> but will not
compare equal with <span class="texttt"><span class="keyword">operator</span><span class="operator">=</span><span class="operator">=</span></span><a class="hidden_link" href="#types.operations-28.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div> <div id="types.operations-note-7" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-7">7</a></i>: <div id="types.operations-28.sentence-3" class="sentence">Because compare-and-exchange acts on an object's value representation,
padding bits that never participate in the object's value representation
are ignored<a class="hidden_link" href="#types.operations-28.sentence-3">.</a></div> <div id="types.operations-28.sentence-4" class="sentence">As a consequence, the following code is guaranteed to avoid
spurious failure:
<span class="codeblock"><span class="keyword">struct</span> padded <span class="curlybracket">{</span>
  <span class="keyword">char</span> clank <span class="operator">=</span> <span class="literal">0x42</span>;
  <span class="comment">// Padding here.</span>
  <span class="keyword">unsigned</span> biff <span class="operator">=</span> <span class="literal">0xC0DEFEFE</span>;
<span class="curlybracket">}</span>;
atomic<span class="anglebracket">&lt;</span>padded<span class="anglebracket">&gt;</span> pad <span class="operator">=</span> <span class="curlybracket">{</span><span class="curlybracket">}</span>;

<span class="keyword">bool</span> zap<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="curlybracket">{</span>
  padded expected, desired<span class="curlybracket">{</span><span class="literal">0</span>, <span class="literal">0</span><span class="curlybracket">}</span>;
  <span class="keyword">return</span> pad<span class="operator">.</span>compare_exchange_strong<span class="parenthesis">(</span>expected, desired<span class="parenthesis">)</span>;
<span class="curlybracket">}</span>
</span></div> —&nbsp;<i>end note</i>]</div></div> <div id="types.operations-note-8" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.operations-note-8">8</a></i>: <div id="types.operations-28.sentence-5" class="sentence">For a union with bits that participate in the value representation
of some members but not others, compare-and-exchange might always fail<a class="hidden_link" href="#types.operations-28.sentence-5">.</a></div> <div id="types.operations-28.sentence-6" class="sentence">This is because such padding bits have an indeterminate value when they
do not participate in the value representation of the active member<a class="hidden_link" href="#types.operations-28.sentence-6">.</a></div> <div id="types.operations-28.sentence-7" class="sentence">As a consequence, the following code is not guaranteed to ever succeed:
<span class="codeblock"><span class="keyword">union</span> pony <span class="curlybracket">{</span>
  <span class="keyword">double</span> celestia <span class="operator">=</span> <span class="literal">0.</span>;
  <span class="keyword">short</span> luna;       <span class="comment">// padded</span>
<span class="curlybracket">}</span>;
atomic<span class="anglebracket">&lt;</span>pony<span class="anglebracket">&gt;</span> princesses <span class="operator">=</span> <span class="curlybracket">{</span><span class="curlybracket">}</span>;

<span class="keyword">bool</span> party<span class="parenthesis">(</span>pony desired<span class="parenthesis">)</span> <span class="curlybracket">{</span>
  pony expected;
  <span class="keyword">return</span> princesses<span class="operator">.</span>compare_exchange_strong<span class="parenthesis">(</span>expected, desired<span class="parenthesis">)</span>;
<span class="curlybracket">}</span>
</span></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,wait"><div id="lib:wait,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,wait"><div id="lib:wait,atomic<integral-type>"><div id="lib:atomic<T*>,wait"><div id="lib:wait,atomic<T*>"><div id="lib:atomic,wait"><div id="lib:wait,atomic"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:wait,atomic">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> wait<span class="parenthesis">(</span>T old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>T old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-29"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-29">29</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4198">#</a></div><div class="texpara"><div id="types.operations-29.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#types.operations-29.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-30"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-30">30</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4206">#</a></div><div class="texpara"><div id="types.operations-30.sentence-1" class="sentence"><i>Effects</i>: Repeatedly performs the following steps, in order:
<ul class="itemize"><li id="types.operations-30.1"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#types.operations-30.1">(30.1)</a></div><div class="texpara"><div id="types.operations-30.1.sentence-1" class="sentence">Evaluates <span class="texttt">load<span class="parenthesis">(</span>order<span class="parenthesis">)</span></span> and
  compares its value representation for equality against that of <span class="texttt">old</span><a class="hidden_link" href="#types.operations-30.1.sentence-1">.</a></div></div></li><li id="types.operations-30.2"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#types.operations-30.2">(30.2)</a></div><div class="texpara"><div id="types.operations-30.2.sentence-1" class="sentence">If they compare unequal, returns<a class="hidden_link" href="#types.operations-30.2.sentence-1">.</a></div></div></li><li id="types.operations-30.3"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#types.operations-30.3">(30.3)</a></div><div class="texpara"><div id="types.operations-30.3.sentence-1" class="sentence">Blocks until it
  is unblocked by an atomic notifying operation or is unblocked spuriously<a class="hidden_link" href="#types.operations-30.3.sentence-1">.</a></div></div></li></ul></div></div></div></div><div class="para" id="types.operations-31"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-31">31</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4220">#</a></div><div class="texpara"><div id="types.operations-31.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic waiting operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#types.operations-31.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,notify_one"><div id="lib:notify_one,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,notify_one"><div id="lib:notify_one,atomic<integral-type>"><div id="lib:atomic<T*>,notify_one"><div id="lib:notify_one,atomic<T*>"><div id="lib:atomic,notify_one"><div id="lib:notify_one,atomic"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_one,atomic">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-32"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-32">32</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4235">#</a></div><div class="texpara"><div id="types.operations-32.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of at least one atomic waiting operation
that is eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call,
if any such atomic waiting operations exist<a class="hidden_link" href="#types.operations-32.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-33"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-33">33</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4241">#</a></div><div class="texpara"><div id="types.operations-33.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#types.operations-33.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,notify_all"><div id="lib:notify_all,atomic<floating-point-type>"><div id="lib:atomic<integral-type>,notify_all"><div id="lib:notify_all,atomic<integral-type>"><div id="lib:atomic<T*>,notify_all"><div id="lib:notify_all,atomic<T*>"><div id="lib:atomic,notify_all"><div id="lib:notify_all,atomic"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_all,atomic">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.operations-34"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-34">34</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4256">#</a></div><div class="texpara"><div id="types.operations-34.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of all atomic waiting operations
that are eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call<a class="hidden_link" href="#types.operations-34.sentence-1">.</a></div></div></div></div><div class="para" id="types.operations-35"><div class="marginalizedparent"><a class="marginalized" href="#types.operations-35">35</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4261">#</a></div><div class="texpara"><div id="types.operations-35.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#types.operations-35.sentence-1">.</a></div></div></div></div></div><div id="types.int" class="section"><h4><a class="secnum" href="#types.int" style="min-width:95pt">33.5.8.3</a> Specializations for integers <a class="abbr_ref" href="atomics.types.int">[atomics.types.int]</a></h4><div class="texpara"><a class="index" id="lib:atomic<integral-type>"></a></div><div class="para" id="types.int-1"><div class="marginalizedparent"><a class="marginalized" href="#types.int-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4269">#</a></div><div class="texpara"><div id="types.int-1.sentence-1" class="sentence">There are specializations of the <span class="texttt">atomic</span>
class template for the integral types
<span class="texttt"><span class="keyword">char</span></span>,
<span class="texttt"><span class="keyword">signed</span> <span class="keyword">char</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">char</span></span>,
<span class="texttt"><span class="keyword">short</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">short</span></span>,
<span class="texttt"><span class="keyword">int</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">int</span></span>,
<span class="texttt"><span class="keyword">long</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">long</span></span>,
<span class="texttt"><span class="keyword">long</span> <span class="keyword">long</span></span>,
<span class="texttt"><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span></span>,
<span id=":char8_t_"><span class="texttt"><span class="keyword">char8_<span class="shy"></span>t</span></span></span>,
<span id=":char16_t_"><span class="texttt"><span class="keyword">char16_<span class="shy"></span>t</span></span></span>,
<span id=":char32_t_"><span class="texttt"><span class="keyword">char32_<span class="shy"></span>t</span></span></span>,
<span id=":wchar_t_"><span class="texttt"><span class="keyword">wchar_<span class="shy"></span>t</span></span></span>,
and any other types needed by the typedefs in the header <a href="cstdint.syn#header:%3ccstdint%3e" title="17.4.1 Header <cstdint> synopsis [cstdint.syn]"><span id="headerref:<cstdint>_"><span class="texttt">&lt;cstdint&gt;</span></span></a><a class="hidden_link" href="#types.int-1.sentence-1">.</a></div> <div id="types.int-1.sentence-2" class="sentence">For each such type <span class="texttt"><i>integral-type</i></span>, the specialization
<span class="texttt">atomic<span class="anglebracket">&lt;</span><i>integral-type</i><span class="anglebracket">&gt;</span></span> provides additional atomic operations appropriate to integral types<a class="hidden_link" href="#types.int-1.sentence-2">.</a></div> <div id="types.int-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.int-note-1">1</a></i>: <div id="types.int-1.sentence-3" class="sentence">The specialization <span class="texttt">atomic<span class="anglebracket">&lt;</span><span class="keyword">bool</span><span class="anglebracket">&gt;</span></span>
uses the primary template (<a href="#types.generic" title="33.5.8 Class template atomic">[atomics.<span class="shy"></span>types.<span class="shy"></span>generic]</a>)<a class="hidden_link" href="#types.int-1.sentence-3">.</a></div> —&nbsp;<i>end note</i>]</div></div></div><div class="texpara"><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic<span class="anglebracket">&lt;</span><i>integral-type</i><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> <i>integral-type</i>;
    <span class="keyword">using</span> difference_type <span class="operator">=</span> value_type;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free__"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> <span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="keyword">void</span> store<span class="parenthesis">(</span><i>integral-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span><i>integral-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">operator</span> <i>integral-type</i><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> <i>integral-type</i><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <i>integral-type</i> exchange<span class="parenthesis">(</span><i>integral-type</i>,
                           memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> exchange<span class="parenthesis">(</span><i>integral-type</i>,
                           memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>integral-type</i><span class="operator">&amp;</span>, <i>integral-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <i>integral-type</i> fetch_add<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_add<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> fetch_sub<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_sub<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> fetch_and<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_and<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> fetch_or<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_or<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> fetch_xor<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_xor<span class="parenthesis">(</span><i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> fetch_max<span class="parenthesis">(</span> <i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_max<span class="parenthesis">(</span> <i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> fetch_min<span class="parenthesis">(</span> <i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> fetch_min<span class="parenthesis">(</span> <i>integral-type</i>,
                            memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">&amp;</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">&amp;</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">|</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">|</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>integral-type</i> <span class="keyword">operator</span><span class="operator">^</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>integral-type</i> <span class="keyword">operator</span><span class="operator">^</span><span class="operator">=</span><span class="parenthesis">(</span><i>integral-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="keyword">void</span> wait<span class="parenthesis">(</span><i>integral-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span><i>integral-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div></div><div class="para" id="types.int-2"><div class="marginalizedparent"><a class="marginalized" href="#types.int-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4399">#</a></div><div class="texpara"><div id="types.int-2.sentence-1" class="sentence">The atomic integral specializations
are standard-layout structs<a class="hidden_link" href="#types.int-2.sentence-1">.</a></div> <div id="types.int-2.sentence-2" class="sentence">They each have
a trivial destructor<a class="hidden_link" href="#types.int-2.sentence-2">.</a></div></div></div><div class="para" id="types.int-3"><div class="marginalizedparent"><a class="marginalized" href="#types.int-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4405">#</a></div><div class="texpara"><div id="types.int-3.sentence-1" class="sentence">Descriptions are provided below only for members that differ from the primary template<a class="hidden_link" href="#types.int-3.sentence-1">.</a></div></div></div><div class="para" id="types.int-4"><div class="marginalizedparent"><a class="marginalized" href="#types.int-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4408">#</a></div><div class="texpara"><div id="types.int-4.sentence-1" class="sentence">The following operations perform arithmetic computations<a class="hidden_link" href="#types.int-4.sentence-1">.</a></div> <div id="types.int-4.sentence-2" class="sentence">The correspondence among key, operator, and computation is specified
in Table <a href="#tab:atomic.types.int.comp" title="Table 148: Atomic arithmetic computations">148</a><a class="hidden_link" href="#types.int-4.sentence-2">.</a></div></div><div class="texpara"><div class="numberedTable" id="tab:atomic.types.int.comp">Table <a href="#tab:atomic.types.int.comp">148</a>: Atomic arithmetic computations <a href="./tab:atomic.types.int.comp">[tab:atomic.types.int.comp]</a><br><table><tbody><tr id="tab:atomic.types.int.comp-row-1" class="rowsep"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.int.comp-row-1">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-1-column-1-sentence-1" class="sentence"><b><span class="texttt"><i>key</i></span></b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-1-column-2-sentence-1" class="sentence"><b>Op</b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-1-column-3-sentence-1" class="sentence"><b>Computation</b></div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-1-column-4-sentence-1" class="sentence"><b><span class="texttt"><i>key</i></span></b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-1-column-5-sentence-1" class="sentence"><b>Op</b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-1-column-6-sentence-1" class="sentence"><b>Computation</b></div></div></td></tr><tr id="tab:atomic.types.int.comp-row-2" class="rowsep"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.int.comp-row-2">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-2-column-1-sentence-1" class="sentence"><span class="texttt">add</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-2-column-2-sentence-1" class="sentence"><span class="texttt"><span class="operator">+</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-2-column-3-sentence-1" class="sentence">addition</div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-2-column-4-sentence-1" class="sentence"><span class="texttt">and</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-2-column-5-sentence-1" class="sentence"><span class="texttt"><span class="operator">&amp;</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-2-column-6-sentence-1" class="sentence">bitwise and</div></div></td></tr><tr id="tab:atomic.types.int.comp-row-3"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.int.comp-row-3">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-3-column-1-sentence-1" class="sentence"><span class="texttt">sub</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-3-column-2-sentence-1" class="sentence"><span class="texttt"><span class="operator">-</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-3-column-3-sentence-1" class="sentence">subtraction</div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-3-column-4-sentence-1" class="sentence"><span class="texttt">or</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-3-column-5-sentence-1" class="sentence"><span class="texttt"><span class="operator">|</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-3-column-6-sentence-1" class="sentence">bitwise inclusive or</div></div></td></tr><tr id="tab:atomic.types.int.comp-row-4"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.int.comp-row-4">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-4-column-1-sentence-1" class="sentence"><span class="texttt">max</span></div></div></td><td class="empty left"></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-4-column-3-sentence-1" class="sentence">maximum</div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-4-column-4-sentence-1" class="sentence"><span class="texttt">xor</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-4-column-5-sentence-1" class="sentence"><span class="texttt"><span class="operator">^</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-4-column-6-sentence-1" class="sentence">bitwise exclusive or</div></div></td></tr><tr id="tab:atomic.types.int.comp-row-5"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.int.comp-row-5">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-5-column-1-sentence-1" class="sentence"><span class="texttt">min</span></div></div></td><td class="empty left"></td><td class="left"><div class="texpara"><div id="tab:atomic.types.int.comp-row-5-column-3-sentence-1" class="sentence">minimum</div></div></td><td class="empty border left"></td><td class="empty left"></td><td class="empty left"></td></tr></tbody></table></div></div></div><div class="texpara"><div id="lib:atomic<integral-type>,fetch_xor"><div id="lib:fetch_xor,atomic<integral-type>"><div id="lib:atomic<integral-type>,fetch_sub"><div id="lib:fetch_sub,atomic<integral-type>"><div id="lib:atomic<integral-type>,fetch_or"><div id="lib:fetch_or,atomic<integral-type>"><div id="lib:atomic<integral-type>,fetch_min"><div id="lib:fetch_min,atomic<integral-type>"><div id="lib:atomic<integral-type>,fetch_max"><div id="lib:fetch_max,atomic<integral-type>"><div id="lib:atomic<integral-type>,fetch_and"><div id="lib:fetch_and,atomic<integral-type>"><div id="lib:atomic<integral-type>,fetch_add"><div id="lib:fetch_add,atomic<integral-type>"><div id="lib:atomic_fetch_xor_explicit"><div id="lib:atomic_fetch_sub_explicit"><div id="lib:atomic_fetch_or_explicit"><div id="lib:atomic_fetch_min_explicit"><div id="lib:atomic_fetch_max_explicit"><div id="lib:atomic_fetch_and_explicit"><div id="lib:atomic_fetch_add_explicit"><div id="lib:atomic_fetch_xor"><div id="lib:atomic_fetch_sub"><div id="lib:atomic_fetch_or"><div id="lib:atomic_fetch_min"><div id="lib:atomic_fetch_max"><div id="lib:atomic_fetch_and"><div id="lib:atomic_fetch_add"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_fetch_add">🔗</a></div><code class="itemdeclcode">T fetch_<i>key</i><span class="parenthesis">(</span>T operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T fetch_<i>key</i><span class="parenthesis">(</span>T operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.int-5"><div class="marginalizedparent"><a class="marginalized" href="#types.int-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4472">#</a></div><div class="texpara"><div id="types.int-5.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.int-5.sentence-1">.</a></div></div></div></div><div class="para" id="types.int-6"><div class="marginalizedparent"><a class="marginalized" href="#types.int-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4477">#</a></div><div class="texpara"><div id="types.int-6.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by
<span id=":this_________"><span class="texttt"><span class="keyword">this</span></span></span> with the result of the computation applied to the
value pointed to by <span id=":this__________"><span class="texttt"><span class="keyword">this</span></span></span> and the given <span class="texttt">operand</span><a class="hidden_link" href="#types.int-6.sentence-1">.</a></div> <div id="types.int-6.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#types.int-6.sentence-2">.</a></div> <div id="types.int-6.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#types.int-6.sentence-3">.</a></div></div></div></div><div class="para" id="types.int-7"><div class="marginalizedparent"><a class="marginalized" href="#types.int-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4485">#</a></div><div class="texpara"><div id="types.int-7.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value pointed to by <span id=":this___________"><span class="texttt"><span class="keyword">this</span></span></span> immediately before the effects<a class="hidden_link" href="#types.int-7.sentence-1">.</a></div></div></div></div><div class="para" id="types.int-8"><div class="marginalizedparent"><a class="marginalized" href="#types.int-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4489">#</a></div><div class="texpara"><div id="types.int-8.sentence-1" class="sentence"><a class="index" id=":signed_integer_representation,two's_complement_"></a><i>Remarks</i>: Except for <span class="texttt">fetch_<span class="shy"></span>max</span> and <span class="texttt">fetch_<span class="shy"></span>min</span>, for signed integer types
the result is as if the object value and parameters
were converted to their corresponding unsigned types,
the computation performed on those types, and
the result converted back to the signed type<a class="hidden_link" href="#types.int-8.sentence-1">.</a></div> <div id="types.int-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.int-note-2">2</a></i>: <div id="types.int-8.sentence-2" class="sentence">There are no undefined results arising from the computation<a class="hidden_link" href="#types.int-8.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="para" id="types.int-9"><div class="marginalizedparent"><a class="marginalized" href="#types.int-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4501">#</a></div><div class="texpara"><div id="types.int-9.sentence-1" class="sentence">For <span class="texttt">fetch_<span class="shy"></span>max</span> and <span class="texttt">fetch_<span class="shy"></span>min</span>, the maximum and minimum
computation is performed as if by <span class="texttt">max</span> and <span class="texttt">min</span> algorithms
 (<a href="alg.min.max" title="27.8.9 Minimum and maximum">[alg.<span class="shy"></span>min.<span class="shy"></span>max]</a>), respectively, with the object value and the first parameter
as the arguments<a class="hidden_link" href="#types.int-9.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<integral-type>,operator^="><div id="lib:operator^=,atomic<integral-type>"><div id="lib:atomic<integral-type>,operator|="><div id="lib:operator|=,atomic<integral-type>"><div id="lib:atomic<integral-type>,operator&amp;="><div id="lib:operator&amp;=,atomic<integral-type>"><div id="lib:atomic<integral-type>,operator-="><div id="lib:operator-=,atomic<integral-type>"><div id="lib:atomic<integral-type>,operator+="><div id="lib:operator+=,atomic<integral-type>"><div id="lib:atomic<T*>,operator-="><div id="lib:operator-=,atomic<T*>"><div id="lib:atomic<T*>,operator+="><div id="lib:operator+=,atomic<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator+=,atomic%3cT*%3e">🔗</a></div><code class="itemdeclcode">T <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>T operand<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>T operand<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.int-10"><div class="marginalizedparent"><a class="marginalized" href="#types.int-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4521">#</a></div><div class="texpara"><div id="types.int-10.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.int-10.sentence-1">.</a></div></div></div></div><div class="para" id="types.int-11"><div class="marginalizedparent"><a class="marginalized" href="#types.int-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4526">#</a></div><div class="texpara"><div id="types.int-11.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span><i>key</i><span class="parenthesis">(</span>operand<span class="parenthesis">)</span> <i>op</i> operand;</span></div></div></div></div></div><div id="types.float" class="section"><h4><a class="secnum" href="#types.float" style="min-width:95pt">33.5.8.4</a> Specializations for floating-point types <a class="abbr_ref" href="atomics.types.float">[atomics.types.float]</a></h4><div class="texpara"><a class="index" id="lib:atomic<floating-point-type>"></a></div><div class="para" id="types.float-1"><div class="marginalizedparent"><a class="marginalized" href="#types.float-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4534">#</a></div><div class="texpara"><div id="types.float-1.sentence-1" class="sentence">There are specializations of the <span class="texttt">atomic</span>
class template for all cv-unqualified floating-point types<a class="hidden_link" href="#types.float-1.sentence-1">.</a></div> <div id="types.float-1.sentence-2" class="sentence">For each such type <span class="texttt"><i>floating-point-type</i></span>,
the specialization <span class="texttt">atomic<span class="anglebracket">&lt;</span><i>floating-point-type</i><span class="anglebracket">&gt;</span></span>
provides additional atomic operations appropriate to floating-point types<a class="hidden_link" href="#types.float-1.sentence-2">.</a></div></div><div class="texpara"><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic<span class="anglebracket">&lt;</span><i>floating-point-type</i><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> <i>floating-point-type</i>;
    <span class="keyword">using</span> difference_type <span class="operator">=</span> value_type;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free___"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="keyword">void</span> store<span class="parenthesis">(</span><i>floating-point-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span><i>floating-point-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>floating-point-type</i> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">operator</span> <i>floating-point-type</i><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> <i>floating-point-type</i><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <i>floating-point-type</i> exchange<span class="parenthesis">(</span><i>floating-point-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> exchange<span class="parenthesis">(</span><i>floating-point-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                               memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                                 memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span><i>floating-point-type</i><span class="operator">&amp;</span>, <i>floating-point-type</i>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <i>floating-point-type</i> fetch_add<span class="parenthesis">(</span><i>floating-point-type</i>,
                                  memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> fetch_add<span class="parenthesis">(</span><i>floating-point-type</i>,
                                  memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>floating-point-type</i> fetch_sub<span class="parenthesis">(</span><i>floating-point-type</i>,
                                  memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> fetch_sub<span class="parenthesis">(</span><i>floating-point-type</i>,
                                  memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><i>floating-point-type</i> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span><i>floating-point-type</i><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="keyword">void</span> wait<span class="parenthesis">(</span><i>floating-point-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span><i>floating-point-type</i>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div></div><div class="para" id="types.float-2"><div class="marginalizedparent"><a class="marginalized" href="#types.float-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4611">#</a></div><div class="texpara"><div id="types.float-2.sentence-1" class="sentence">The atomic floating-point specializations
are standard-layout structs<a class="hidden_link" href="#types.float-2.sentence-1">.</a></div> <div id="types.float-2.sentence-2" class="sentence">They each have
a trivial destructor<a class="hidden_link" href="#types.float-2.sentence-2">.</a></div></div></div><div class="para" id="types.float-3"><div class="marginalizedparent"><a class="marginalized" href="#types.float-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4617">#</a></div><div class="texpara"><div id="types.float-3.sentence-1" class="sentence">Descriptions are provided below only for members that differ from the primary template<a class="hidden_link" href="#types.float-3.sentence-1">.</a></div></div></div><div class="para" id="types.float-4"><div class="marginalizedparent"><a class="marginalized" href="#types.float-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4620">#</a></div><div class="texpara"><div id="types.float-4.sentence-1" class="sentence">The following operations perform arithmetic addition and subtraction computations<a class="hidden_link" href="#types.float-4.sentence-1">.</a></div> <div id="types.float-4.sentence-2" class="sentence">The correspondence among key, operator, and computation is specified
in Table <a href="#tab:atomic.types.int.comp" title="Table 148: Atomic arithmetic computations">148</a><a class="hidden_link" href="#types.float-4.sentence-2">.</a></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,fetch_sub"><div id="lib:fetch_sub,atomic<floating-point-type>"><div id="lib:atomic<floating-point-type>,fetch_add"><div id="lib:fetch_add,atomic<floating-point-type>"><div id="lib:atomic_fetch_sub_explicit_"><div id="lib:atomic_fetch_add_explicit_"><div id="lib:atomic_fetch_sub_"><div id="lib:atomic_fetch_add_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_fetch_add_">🔗</a></div><code class="itemdeclcode">T fetch_<i>key</i><span class="parenthesis">(</span>T operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T fetch_<i>key</i><span class="parenthesis">(</span>T operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.float-5"><div class="marginalizedparent"><a class="marginalized" href="#types.float-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4637">#</a></div><div class="texpara"><div id="types.float-5.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.float-5.sentence-1">.</a></div></div></div></div><div class="para" id="types.float-6"><div class="marginalizedparent"><a class="marginalized" href="#types.float-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4642">#</a></div><div class="texpara"><div id="types.float-6.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by <span id=":this____________"><span class="texttt"><span class="keyword">this</span></span></span>
with the result of the computation applied to the value pointed
to by <span id=":this_____________"><span class="texttt"><span class="keyword">this</span></span></span> and the given <span class="texttt">operand</span><a class="hidden_link" href="#types.float-6.sentence-1">.</a></div> <div id="types.float-6.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#types.float-6.sentence-2">.</a></div> <div id="types.float-6.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#types.float-6.sentence-3">.</a></div></div></div></div><div class="para" id="types.float-7"><div class="marginalizedparent"><a class="marginalized" href="#types.float-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4650">#</a></div><div class="texpara"><div id="types.float-7.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value pointed to by <span id=":this______________"><span class="texttt"><span class="keyword">this</span></span></span> immediately before the effects<a class="hidden_link" href="#types.float-7.sentence-1">.</a></div></div></div></div><div class="para" id="types.float-8"><div class="marginalizedparent"><a class="marginalized" href="#types.float-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4654">#</a></div><div class="texpara"><div id="types.float-8.sentence-1" class="sentence"><i>Remarks</i>: If the result is not a representable value for its type (<a href="expr.pre" title="7.1 Preamble">[expr.<span class="shy"></span>pre]</a>)
the result is unspecified, but the operations otherwise have no undefined
behavior<a class="hidden_link" href="#types.float-8.sentence-1">.</a></div> <div id="types.float-8.sentence-2" class="sentence">Atomic arithmetic operations on <span class="texttt"><i>floating-point-type</i></span>
should conform to the <span class="texttt">std<span class="operator">​::​</span>numeric_<span class="shy"></span>limits<span class="anglebracket">&lt;</span><i>floating-point-type</i><span class="anglebracket">&gt;</span></span>
traits associated with the floating-point type (<a href="limits.syn" title="17.3.3 Header <limits> synopsis">[limits.<span class="shy"></span>syn]</a>)<a class="hidden_link" href="#types.float-8.sentence-2">.</a></div> <div id="types.float-8.sentence-3" class="sentence">The floating-point environment (<a href="cfenv" title="28.3 The floating-point environment">[cfenv]</a>) for atomic arithmetic operations
on <span class="texttt"><i>floating-point-type</i></span> may be different than the
calling thread's floating-point environment<a class="hidden_link" href="#types.float-8.sentence-3">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<floating-point-type>,operator-="><div id="lib:operator-=,atomic<floating-point-type>"><div id="lib:atomic<floating-point-type>,operator+="><div id="lib:operator+=,atomic<floating-point-type>"><div id="lib:atomic<T*>,operator-=_"><div id="lib:operator-=,atomic<T*>_"><div id="lib:atomic<T*>,operator+=_"><div id="lib:operator+=,atomic<T*>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator+=,atomic%3cT*%3e_">🔗</a></div><code class="itemdeclcode">T <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>T operand<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>T operand<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.float-9"><div class="marginalizedparent"><a class="marginalized" href="#types.float-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4676">#</a></div><div class="texpara"><div id="types.float-9.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.float-9.sentence-1">.</a></div></div></div></div><div class="para" id="types.float-10"><div class="marginalizedparent"><a class="marginalized" href="#types.float-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4681">#</a></div><div class="texpara"><div id="types.float-10.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span><i>key</i><span class="parenthesis">(</span>operand<span class="parenthesis">)</span> <i>op</i> operand;</span></div></div></div></div><div class="para" id="types.float-11"><div class="marginalizedparent"><a class="marginalized" href="#types.float-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4685">#</a></div><div class="texpara"><div id="types.float-11.sentence-1" class="sentence"><i>Remarks</i>: If the result is not a representable value for its type (<a href="expr.pre" title="7.1 Preamble">[expr.<span class="shy"></span>pre]</a>)
the result is unspecified, but the operations otherwise have no undefined
behavior<a class="hidden_link" href="#types.float-11.sentence-1">.</a></div> <div id="types.float-11.sentence-2" class="sentence">Atomic arithmetic operations on <span class="texttt"><i>floating-point-type</i></span>
should conform to the <span class="texttt">std<span class="operator">​::​</span>numeric_<span class="shy"></span>limits<span class="anglebracket">&lt;</span><i>floating-point-type</i><span class="anglebracket">&gt;</span></span>
traits associated with the floating-point type (<a href="limits.syn" title="17.3.3 Header <limits> synopsis">[limits.<span class="shy"></span>syn]</a>)<a class="hidden_link" href="#types.float-11.sentence-2">.</a></div> <div id="types.float-11.sentence-3" class="sentence">The floating-point environment (<a href="cfenv" title="28.3 The floating-point environment">[cfenv]</a>) for atomic arithmetic operations
on <span class="texttt"><i>floating-point-type</i></span> may be different than the
calling thread's floating-point environment<a class="hidden_link" href="#types.float-11.sentence-3">.</a></div></div></div></div></div><div id="types.pointer" class="section"><h4><a class="secnum" href="#types.pointer" style="min-width:95pt">33.5.8.5</a> Partial specialization for pointers <a class="abbr_ref" href="atomics.types.pointer">[atomics.types.pointer]</a></h4><div class="texpara"><a class="index" id="lib:atomic<T*>"></a>
<span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic<span class="anglebracket">&lt;</span>T<span class="operator">*</span><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> T<span class="operator">*</span>;
    <span class="keyword">using</span> difference_type <span class="operator">=</span> ptrdiff_t;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free____"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span>T<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="keyword">void</span> store<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>T<span class="operator">*</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> load<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">operator</span> T<span class="operator">*</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> T<span class="operator">*</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    T<span class="operator">*</span> exchange<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> exchange<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>, memory_order, memory_order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                               memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>T<span class="operator">*</span><span class="operator">&amp;</span>, T<span class="operator">*</span>,
                                 memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    T<span class="operator">*</span> fetch_add<span class="parenthesis">(</span>ptrdiff_t, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_add<span class="parenthesis">(</span>ptrdiff_t, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> fetch_sub<span class="parenthesis">(</span>ptrdiff_t, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_sub<span class="parenthesis">(</span>ptrdiff_t, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> fetch_max<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_max<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> fetch_min<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> fetch_min<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span>ptrdiff_t<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">+</span><span class="operator">=</span><span class="parenthesis">(</span>ptrdiff_t<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span>ptrdiff_t<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span><span class="operator">-</span><span class="operator">=</span><span class="parenthesis">(</span>ptrdiff_t<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="keyword">void</span> wait<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>T<span class="operator">*</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span><a class="index" id="lib:atomic<T*>_"></a></div><div class="para" id="types.pointer-1"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4773">#</a></div><div class="texpara"><div id="types.pointer-1.sentence-1" class="sentence">There is a partial specialization of the <span class="texttt">atomic</span> class template for pointers<a class="hidden_link" href="#types.pointer-1.sentence-1">.</a></div> <div id="types.pointer-1.sentence-2" class="sentence">Specializations of this partial specialization are standard-layout structs<a class="hidden_link" href="#types.pointer-1.sentence-2">.</a></div> <div id="types.pointer-1.sentence-3" class="sentence">They each have a trivial destructor<a class="hidden_link" href="#types.pointer-1.sentence-3">.</a></div></div></div><div class="para" id="types.pointer-2"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4778">#</a></div><div class="texpara"><div id="types.pointer-2.sentence-1" class="sentence">Descriptions are provided below only for members that differ from the primary template<a class="hidden_link" href="#types.pointer-2.sentence-1">.</a></div></div></div><div class="para" id="types.pointer-3"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4781">#</a></div><div class="texpara"><div id="types.pointer-3.sentence-1" class="sentence">The following operations perform pointer arithmetic<a class="hidden_link" href="#types.pointer-3.sentence-1">.</a></div> <div id="types.pointer-3.sentence-2" class="sentence">The correspondence among key, operator, and computation is specified
in Table <a href="#tab:atomic.types.pointer.comp" title="Table 149: Atomic pointer computations">149</a><a class="hidden_link" href="#types.pointer-3.sentence-2">.</a></div></div><div class="texpara"><div class="numberedTable" id="tab:atomic.types.pointer.comp">Table <a href="#tab:atomic.types.pointer.comp">149</a>: Atomic pointer computations <a href="./tab:atomic.types.pointer.comp">[tab:atomic.types.pointer.comp]</a><br><table><tbody><tr id="tab:atomic.types.pointer.comp-row-1" class="rowsep"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.pointer.comp-row-1">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-1-column-1-sentence-1" class="sentence"><b><span class="texttt"><i>key</i></span></b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-1-column-2-sentence-1" class="sentence"><b>Op</b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-1-column-3-sentence-1" class="sentence"><b>Computation</b></div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-1-column-4-sentence-1" class="sentence"><b><span class="texttt"><i>key</i></span></b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-1-column-5-sentence-1" class="sentence"><b>Op</b></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-1-column-6-sentence-1" class="sentence"><b>Computation</b></div></div></td></tr><tr id="tab:atomic.types.pointer.comp-row-2" class="rowsep"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.pointer.comp-row-2">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-2-column-1-sentence-1" class="sentence"><span class="texttt">add</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-2-column-2-sentence-1" class="sentence"><span class="texttt"><span class="operator">+</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-2-column-3-sentence-1" class="sentence">addition</div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-2-column-4-sentence-1" class="sentence"><span class="texttt">sub</span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-2-column-5-sentence-1" class="sentence"><span class="texttt"><span class="operator">-</span></span></div></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-2-column-6-sentence-1" class="sentence">subtraction</div></div></td></tr><tr id="tab:atomic.types.pointer.comp-row-3"><td class="hidden"><div class="marginalizedparent"><a class="itemDeclLink" href="#tab:atomic.types.pointer.comp-row-3">🔗</a></div></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-3-column-1-sentence-1" class="sentence"><span class="texttt">max</span></div></div></td><td class="empty left"></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-3-column-3-sentence-1" class="sentence">maximum</div></div></td><td class="border left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-3-column-4-sentence-1" class="sentence"><span class="texttt">min</span></div></div></td><td class="empty left"></td><td class="left"><div class="texpara"><div id="tab:atomic.types.pointer.comp-row-3-column-6-sentence-1" class="sentence">minimum</div></div></td></tr></tbody></table></div></div></div><div class="texpara"><div id="lib:atomic<T*>,fetch_sub"><div id="lib:fetch_sub,atomic<T*>"><div id="lib:atomic<T*>,fetch_min"><div id="lib:fetch_min,atomic<T*>"><div id="lib:atomic<T*>,fetch_max"><div id="lib:fetch_max,atomic<T*>"><div id="lib:atomic<T*>,fetch_add"><div id="lib:fetch_add,atomic<T*>"><div id="lib:atomic_fetch_sub_explicit__"><div id="lib:atomic_fetch_min_explicit_"><div id="lib:atomic_fetch_max_explicit_"><div id="lib:atomic_fetch_add_explicit__"><div id="lib:atomic_fetch_sub__"><div id="lib:atomic_fetch_min_"><div id="lib:atomic_fetch_max_"><div id="lib:atomic_fetch_add__"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_fetch_add__">🔗</a></div><code class="itemdeclcode">T<span class="operator">*</span> fetch_<i>key</i><span class="parenthesis">(</span>ptrdiff_t operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T<span class="operator">*</span> fetch_<i>key</i><span class="parenthesis">(</span>ptrdiff_t operand, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="para" id="types.pointer-4"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4827">#</a></div><div class="texpara"><div id="types.pointer-4.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.pointer-4.sentence-1">.</a></div></div></div></div><div class="para" id="types.pointer-5"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4832">#</a></div><div class="texpara"><div id="types.pointer-5.sentence-1" class="sentence"><i>Mandates</i>: <span class="texttt">T</span> is a complete object type<a class="hidden_link" href="#types.pointer-5.sentence-1">.</a></div> <div id="types.pointer-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.pointer-note-1">1</a></i>: <div id="types.pointer-5.sentence-2" class="sentence">Pointer arithmetic on <span class="texttt"><span class="keyword">void</span><span class="operator">*</span></span> or function pointers is ill-formed<a class="hidden_link" href="#types.pointer-5.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="para" id="types.pointer-6"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4839">#</a></div><div class="texpara"><div id="types.pointer-6.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by
<span id=":this_______________"><span class="texttt"><span class="keyword">this</span></span></span> with the result of the computation applied to the
value pointed to by <span id=":this________________"><span class="texttt"><span class="keyword">this</span></span></span> and the given <span class="texttt">operand</span><a class="hidden_link" href="#types.pointer-6.sentence-1">.</a></div> <div id="types.pointer-6.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#types.pointer-6.sentence-2">.</a></div> <div id="types.pointer-6.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#types.pointer-6.sentence-3">.</a></div></div></div></div><div class="para" id="types.pointer-7"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4847">#</a></div><div class="texpara"><div id="types.pointer-7.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value pointed to by <span id=":this_________________"><span class="texttt"><span class="keyword">this</span></span></span> immediately before the effects<a class="hidden_link" href="#types.pointer-7.sentence-1">.</a></div></div></div></div><div class="para" id="types.pointer-8"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4851">#</a></div><div class="texpara"><div id="types.pointer-8.sentence-1" class="sentence"><i>Remarks</i>: The result may be an undefined address,
but the operations otherwise have no undefined behavior<a class="hidden_link" href="#types.pointer-8.sentence-1">.</a></div></div></div></div><div class="para" id="types.pointer-9"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4856">#</a></div><div class="texpara"><div id="types.pointer-9.sentence-1" class="sentence">For <span class="texttt">fetch_<span class="shy"></span>max</span> and <span class="texttt">fetch_<span class="shy"></span>min</span>, the maximum and minimum
computation is performed as if by <span class="texttt">max</span> and <span class="texttt">min</span>
algorithms (<a href="alg.min.max" title="27.8.9 Minimum and maximum">[alg.<span class="shy"></span>min.<span class="shy"></span>max]</a>), respectively, with the object value and the first
parameter as the arguments<a class="hidden_link" href="#types.pointer-9.sentence-1">.</a></div></div><div class="texpara"><div id="types.pointer-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#types.pointer-note-2">2</a></i>: <div id="types.pointer-9.sentence-2" class="sentence">If the pointers point to different complete objects (or subobjects thereof),
the <span class="texttt"><span class="anglebracket">&lt;</span></span> operator does not establish a strict weak ordering
(Table <a href="utility.arg.requirements#tab:cpp17.lessthancomparable" title="Table 29: Cpp17LessThanComparable requirements">29</a>, <a href="expr.rel" title="7.6.9 Relational operators">[expr.<span class="shy"></span>rel]</a>)<a class="hidden_link" href="#types.pointer-9.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<T*>,operator-=__"><div id="lib:operator-=,atomic<T*>__"><div id="lib:atomic<T*>,operator+=__"><div id="lib:operator+=,atomic<T*>__"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator+=,atomic%3cT*%3e__">🔗</a></div><code class="itemdeclcode">T<span class="operator">*</span> <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>ptrdiff_t operand<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>T<span class="operator">*</span> <span class="keyword">operator</span> <i>op</i><span class="operator">=</span><span class="parenthesis">(</span>ptrdiff_t operand<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="types.pointer-10"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4877">#</a></div><div class="texpara"><div id="types.pointer-10.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.pointer-10.sentence-1">.</a></div></div></div></div><div class="para" id="types.pointer-11"><div class="marginalizedparent"><a class="marginalized" href="#types.pointer-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4882">#</a></div><div class="texpara"><div id="types.pointer-11.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span><i>key</i><span class="parenthesis">(</span>operand<span class="parenthesis">)</span> <i>op</i> operand;</span></div></div></div></div></div><div id="types.memop" class="section"><h4><a class="secnum" href="#types.memop" style="min-width:95pt">33.5.8.6</a> Member operators common to integers and pointers to objects <a class="abbr_ref" href="atomics.types.memop">[atomics.types.memop]</a></h4><div class="texpara"><div id="lib:atomic<integral-type>,operator++"><div id="lib:operator++,atomic<integral-type>"><div id="lib:atomic<T*>,operator++"><div id="lib:operator++,atomic<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator++,atomic%3cT*%3e">🔗</a></div><code class="itemdeclcode">value_type <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="types.memop-1"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-1">1</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4897">#</a></div><div class="texpara"><div id="types.memop-1.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.memop-1.sentence-1">.</a></div></div></div></div><div class="para" id="types.memop-2"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-2">2</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4902">#</a></div><div class="texpara"><div id="types.memop-2.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>add<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic<integral-type>,operator--"><div id="lib:operator--,atomic<integral-type>"><div id="lib:atomic<T*>,operator--"><div id="lib:operator--,atomic<T*>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator--,atomic%3cT*%3e">🔗</a></div><code class="itemdeclcode">value_type <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="keyword">int</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="types.memop-3"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4915">#</a></div><div class="texpara"><div id="types.memop-3.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.memop-3.sentence-1">.</a></div></div></div></div><div class="para" id="types.memop-4"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4920">#</a></div><div class="texpara"><div id="types.memop-4.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>sub<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic<integral-type>,operator++_"><div id="lib:operator++,atomic<integral-type>_"><div id="lib:atomic<T*>,operator++_"><div id="lib:operator++,atomic<T*>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator++,atomic%3cT*%3e_">🔗</a></div><code class="itemdeclcode">value_type <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">+</span><span class="operator">+</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="types.memop-5"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4933">#</a></div><div class="texpara"><div id="types.memop-5.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.memop-5.sentence-1">.</a></div></div></div></div><div class="para" id="types.memop-6"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4938">#</a></div><div class="texpara"><div id="types.memop-6.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>add<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span> <span class="operator">+</span> <span class="literal">1</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic<integral-type>,operator--_"><div id="lib:operator--,atomic<integral-type>_"><div id="lib:atomic<T*>,operator--_"><div id="lib:operator--,atomic<T*>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator--,atomic%3cT*%3e_">🔗</a></div><code class="itemdeclcode">value_type <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span>value_type <span class="keyword">operator</span><span class="operator">-</span><span class="operator">-</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="types.memop-7"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4951">#</a></div><div class="texpara"><div id="types.memop-7.sentence-1" class="sentence"><i>Constraints</i>: For the <span class="texttt"><span class="keyword">volatile</span></span> overload of this function,
<span class="texttt">is_<span class="shy"></span>always_<span class="shy"></span>lock_<span class="shy"></span>free</span> is <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#types.memop-7.sentence-1">.</a></div></div></div></div><div class="para" id="types.memop-8"><div class="marginalizedparent"><a class="marginalized" href="#types.memop-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4956">#</a></div><div class="texpara"><div id="types.memop-8.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> fetch_<span class="shy"></span>sub<span class="parenthesis">(</span><span class="literal">1</span><span class="parenthesis">)</span> <span class="operator">-</span> <span class="literal">1</span>;</span></div></div></div></div></div><div id="util.smartptr.atomic" class="section"><h4><a class="secnum" href="#util.smartptr.atomic" style="min-width:95pt">33.5.8.7</a> Partial specializations for smart pointers <a class="abbr_ref" href="util.smartptr.atomic">[util.smartptr.atomic]</a></h4><div class="texpara"><a class="index" id=":atomic,smart_pointers"></a></div><div id="util.smartptr.atomic.general" class="section"><h4><a class="secnum" href="#util.smartptr.atomic.general" style="min-width:110pt">33.5.8.7.1</a> General <a class="abbr_ref" href="util.smartptr.atomic.general">[util.smartptr.atomic.general]</a></h4><div class="para" id="util.smartptr.atomic.general-1"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.general-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4966">#</a></div><div class="texpara"><div id="util.smartptr.atomic.general-1.sentence-1" class="sentence">The library provides partial specializations of the <span class="texttt">atomic</span> template
for shared-ownership smart pointers (<a href="util.sharedptr" title="20.3.2 Shared-ownership pointers">[util.<span class="shy"></span>sharedptr]</a>)<a class="hidden_link" href="#util.smartptr.atomic.general-1.sentence-1">.</a></div> <div id="util.smartptr.atomic.general-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#util.smartptr.atomic.general-note-1">1</a></i>: <div id="util.smartptr.atomic.general-1.sentence-2" class="sentence">The partial specializations are declared in header <a href="memory.syn#header:%3cmemory%3e" title="20.2.2 Header <memory> synopsis [memory.syn]"><span id="headerref:<memory>"><span class="texttt">&lt;memory&gt;</span></span></a><a class="hidden_link" href="#util.smartptr.atomic.general-1.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div> <div id="util.smartptr.atomic.general-1.sentence-3" class="sentence">
The behavior of all operations is as specified in <a href="#types.generic" title="33.5.8 Class template atomic">[atomics.<span class="shy"></span>types.<span class="shy"></span>generic]</a>,
unless specified otherwise<a class="hidden_link" href="#util.smartptr.atomic.general-1.sentence-3">.</a></div> <div id="util.smartptr.atomic.general-1.sentence-4" class="sentence">The template parameter <span class="texttt">T</span> of these partial specializations
may be an incomplete type<a class="hidden_link" href="#util.smartptr.atomic.general-1.sentence-4">.</a></div></div></div><div class="para" id="util.smartptr.atomic.general-2"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.general-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4977">#</a></div><div class="texpara"><div id="util.smartptr.atomic.general-2.sentence-1" class="sentence">All changes to an atomic smart pointer in <a href="#util.smartptr.atomic" title="33.5.8.7 Partial specializations for smart pointers">[util.<span class="shy"></span>smartptr.<span class="shy"></span>atomic]</a>, and
all associated <span class="texttt">use_<span class="shy"></span>count</span> increments,
are guaranteed to be performed atomically<a class="hidden_link" href="#util.smartptr.atomic.general-2.sentence-1">.</a></div> <div id="util.smartptr.atomic.general-2.sentence-2" class="sentence">Associated <span class="texttt">use_<span class="shy"></span>count</span> decrements
are sequenced after the atomic operation,
but are not required to be part of it<a class="hidden_link" href="#util.smartptr.atomic.general-2.sentence-2">.</a></div> <div id="util.smartptr.atomic.general-2.sentence-3" class="sentence">Any associated deletion and deallocation
are sequenced after the atomic update step and
are not part of the atomic operation<a class="hidden_link" href="#util.smartptr.atomic.general-2.sentence-3">.</a></div> <div id="util.smartptr.atomic.general-note-2" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#util.smartptr.atomic.general-note-2">2</a></i>: <div id="util.smartptr.atomic.general-2.sentence-4" class="sentence">If the atomic operation uses locks,
locks acquired by the implementation
will be held when any <span class="texttt">use_<span class="shy"></span>count</span> adjustments are performed, and
will not be held when any destruction or deallocation
resulting from this is performed<a class="hidden_link" href="#util.smartptr.atomic.general-2.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div><div class="para nonNormativeOnly" id="util.smartptr.atomic.general-3"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.general-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L4995">#</a></div><div class="texpara"><div id="util.smartptr.atomic.general-example-1" class="example"><div class="texpara">[<i>Example&nbsp;<a href="#util.smartptr.atomic.general-example-1">1</a></i>: <span class="codeblock"><span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">typename</span> T<span class="anglebracket">&gt;</span> <span class="keyword">class</span> atomic_list <span class="curlybracket">{</span>
  <span class="keyword">struct</span> node <span class="curlybracket">{</span>
    T t;
    shared_ptr<span class="anglebracket">&lt;</span>node<span class="anglebracket">&gt;</span> next;
  <span class="curlybracket">}</span>;
  atomic<span class="anglebracket">&lt;</span>shared_ptr<span class="anglebracket">&lt;</span>node<span class="anglebracket">&gt;</span><span class="anglebracket">&gt;</span> head;

<span class="keyword">public</span><span class="operator">:</span>
  shared_ptr<span class="anglebracket">&lt;</span>node<span class="anglebracket">&gt;</span> find<span class="parenthesis">(</span>T t<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="curlybracket">{</span>
    <span class="keyword">auto</span> p <span class="operator">=</span> head<span class="operator">.</span>load<span class="parenthesis">(</span><span class="parenthesis">)</span>;
    <span class="keyword">while</span> <span class="parenthesis">(</span>p <span class="operator">&amp;</span><span class="operator">&amp;</span> p<span class="operator">-</span><span class="anglebracket">&gt;</span>t <span class="operator">!</span><span class="operator">=</span> t<span class="parenthesis">)</span>
      p <span class="operator">=</span> p<span class="operator">-</span><span class="anglebracket">&gt;</span>next;

    <span class="keyword">return</span> p;
  <span class="curlybracket">}</span>

  <span class="keyword">void</span> push_front<span class="parenthesis">(</span>T t<span class="parenthesis">)</span> <span class="curlybracket">{</span>
    <span class="keyword">auto</span> p <span class="operator">=</span> make_shared<span class="anglebracket">&lt;</span>node<span class="anglebracket">&gt;</span><span class="parenthesis">(</span><span class="parenthesis">)</span>;
    p<span class="operator">-</span><span class="anglebracket">&gt;</span>t <span class="operator">=</span> t;
    p<span class="operator">-</span><span class="anglebracket">&gt;</span>next <span class="operator">=</span> head;
    <span class="keyword">while</span> <span class="parenthesis">(</span><span class="operator">!</span>head<span class="operator">.</span>compare_exchange_weak<span class="parenthesis">(</span>p<span class="operator">-</span><span class="anglebracket">&gt;</span>next, p<span class="parenthesis">)</span><span class="parenthesis">)</span> <span class="curlybracket">{</span><span class="curlybracket">}</span>
  <span class="curlybracket">}</span>
<span class="curlybracket">}</span>;
</span> —&nbsp;<i>end example</i>]</div></div></div></div></div><div id="util.smartptr.atomic.shared" class="section"><h4><a class="secnum" href="#util.smartptr.atomic.shared" style="min-width:110pt">33.5.8.7.2</a> Partial specialization for <span class="texttt">shared_<span class="shy"></span>ptr</span> <a class="abbr_ref" href="util.smartptr.atomic.shared">[util.smartptr.atomic.shared]</a></h4><div class="texpara"><span id="lib:atomic<shared_ptr<T>>"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic<span class="anglebracket">&lt;</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span>;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free_____"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span>nullptr_t<span class="parenthesis">)</span> <span class="keyword">noexcept</span> <span class="operator">:</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="curlybracket">{</span> <span class="curlybracket">}</span>
    <span class="added">constexpr </span>atomic<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    <span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="added">constexpr </span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>nullptr_t<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> exchange<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                           memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                               memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                                 memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                               memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                                 memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

  <span class="keyword">private</span><span class="operator">:</span>
    shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> p;            <span class="comment">// <i>exposition only</i></span>
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></span></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,constructor"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic%3cshared_ptr%3cT%3e%3e,constructor">🔗</a></div><code class="itemdeclcode"><span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="util.smartptr.atomic.shared-1"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-1">1</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5073">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-1.sentence-1" class="sentence"><i>Effects</i>: Initializes <span class="texttt">p<span class="curlybracket">{</span><span class="curlybracket">}</span></span><a class="hidden_link" href="#util.smartptr.atomic.shared-1.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,constructor_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic%3cshared_ptr%3cT%3e%3e,constructor_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>atomic<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="util.smartptr.atomic.shared-2"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-2">2</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5084">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-2.sentence-1" class="sentence"><i>Effects</i>: Initializes the object with the value <span class="texttt">desired</span><a class="hidden_link" href="#util.smartptr.atomic.shared-2.sentence-1">.</a></div> <div id="util.smartptr.atomic.shared-2.sentence-2" class="sentence">Initialization is not an atomic operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#util.smartptr.atomic.shared-2.sentence-2">.</a></div> <div id="util.smartptr.atomic.shared-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#util.smartptr.atomic.shared-note-1">1</a></i>: <div id="util.smartptr.atomic.shared-2.sentence-3" class="sentence">It is possible to have an access to
an atomic object <span class="texttt">A</span> race with its construction,
for example,
by communicating the address of the just-constructed object <span class="texttt">A</span>
to another thread via <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span> operations
on a suitable atomic pointer variable, and
then immediately accessing <span class="texttt">A</span> in the receiving thread<a class="hidden_link" href="#util.smartptr.atomic.shared-2.sentence-3">.</a></div> <div id="util.smartptr.atomic.shared-2.sentence-4" class="sentence">This results in undefined behavior<a class="hidden_link" href="#util.smartptr.atomic.shared-2.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,store"><div id="lib:store,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:store,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-3"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5106">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-3.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.shared-3.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-4"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5113">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-4.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by <span id=":this__________________"><span class="texttt"><span class="keyword">this</span></span></span> with
the value of <span class="texttt">desired</span> as if by <span class="texttt">p<span class="operator">.</span>swap<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.shared-4.sentence-1">.</a></div> <div id="util.smartptr.atomic.shared-4.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#util.smartptr.atomic.shared-4.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,operator="><div id="lib:operator=,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator=,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-5"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5126">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-5.sentence-1" class="sentence"><i>Effects</i>: Equivalent to <span class="texttt">store<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.shared-5.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,operator=_"><div id="lib:operator=,atomic<shared_ptr<T>>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator=,atomic%3cshared_ptr%3cT%3e%3e_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>nullptr_t<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-6"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5137">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-6.sentence-1" class="sentence"><i>Effects</i>: Equivalent to <span class="texttt">store<span class="parenthesis">(</span><span class="literal">nullptr</span><span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.shared-6.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,load"><div id="lib:load,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:load,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-7"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5148">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-7.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.shared-7.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-8"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5156">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-8.sentence-1" class="sentence"><i>Effects</i>: Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#util.smartptr.atomic.shared-8.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-9"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5160">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-9.sentence-1" class="sentence"><i>Returns</i>: Atomically returns <span class="texttt">p</span><a class="hidden_link" href="#util.smartptr.atomic.shared-9.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,operator_shared_ptr<T>"><div id="lib:operator_shared_ptr<T>,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator_shared_ptr%3cT%3e,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">operator</span> shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-10"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5171">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-10.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> load<span class="parenthesis">(</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,exchange"><div id="lib:exchange,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:exchange,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> exchange<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-11"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5182">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-11.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces <span class="texttt">p</span> with <span class="texttt">desired</span>
as if by <span class="texttt">p<span class="operator">.</span>swap<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.shared-11.sentence-1">.</a></div> <div id="util.smartptr.atomic.shared-11.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#util.smartptr.atomic.shared-11.sentence-2">.</a></div> <div id="util.smartptr.atomic.shared-11.sentence-3" class="sentence">This is an atomic read-modify-write operation (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#util.smartptr.atomic.shared-11.sentence-3">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-12"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-12">12</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5189">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-12.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value of <span class="texttt">p</span> immediately before the effects<a class="hidden_link" href="#util.smartptr.atomic.shared-12.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic<shared_ptr<T>>"><div id="lib:atomic<shared_ptr<T>>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_weak,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                           memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                             memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-13"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-13">13</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5204">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-13.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">failure</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.shared-13.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-14"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-14">14</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5212">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-14.sentence-1" class="sentence"><i>Effects</i>: If <span class="texttt">p</span> is equivalent to <span class="texttt">expected</span>,
assigns <span class="texttt">desired</span> to <span class="texttt">p</span> and
has synchronization semantics corresponding to the value of <span class="texttt">success</span>,
otherwise assigns <span class="texttt">p</span> to <span class="texttt">expected</span> and
has synchronization semantics corresponding to the value of <span class="texttt">failure</span><a class="hidden_link" href="#util.smartptr.atomic.shared-14.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-15"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-15">15</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5220">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-15.sentence-1" class="sentence"><i>Returns</i>: <span class="texttt"><span class="literal">true</span></span> if <span class="texttt">p</span> was equivalent to <span class="texttt">expected</span>,
<span class="texttt"><span class="literal">false</span></span> otherwise<a class="hidden_link" href="#util.smartptr.atomic.shared-15.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-16"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-16">16</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5225">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-16.sentence-1" class="sentence"><i>Remarks</i>: Two <span class="texttt">shared_<span class="shy"></span>ptr</span> objects are equivalent if
they store the same pointer value and
either share ownership or are both empty<a class="hidden_link" href="#util.smartptr.atomic.shared-16.sentence-1">.</a></div> <div id="util.smartptr.atomic.shared-16.sentence-2" class="sentence">The weak form may fail spuriously<a class="hidden_link" href="#util.smartptr.atomic.shared-16.sentence-2">.</a></div> <div id="util.smartptr.atomic.shared-16.sentence-3" class="sentence">See <a href="#types.operations" title="33.5.8.2 Operations on atomic types">[atomics.<span class="shy"></span>types.<span class="shy"></span>operations]</a><a class="hidden_link" href="#util.smartptr.atomic.shared-16.sentence-3">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-17"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-17">17</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5232">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-17.sentence-1" class="sentence">If the operation returns <span class="texttt"><span class="literal">true</span></span>,
<span class="texttt">expected</span> is not accessed after the atomic update and
the operation is an atomic read-modify-write operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)
on the memory pointed to by <span id=":this___________________"><span class="texttt"><span class="keyword">this</span></span></span><a class="hidden_link" href="#util.smartptr.atomic.shared-17.sentence-1">.</a></div> <div id="util.smartptr.atomic.shared-17.sentence-2" class="sentence">Otherwise, the operation is an atomic load operation on that memory, and
<span class="texttt">expected</span> is updated with the existing value
read from the atomic object in the attempted atomic update<a class="hidden_link" href="#util.smartptr.atomic.shared-17.sentence-2">.</a></div> <div id="util.smartptr.atomic.shared-17.sentence-3" class="sentence">The <span class="texttt">use_<span class="shy"></span>count</span> update corresponding to the write to <span class="texttt">expected</span>
is part of the atomic operation<a class="hidden_link" href="#util.smartptr.atomic.shared-17.sentence-3">.</a></div> <div id="util.smartptr.atomic.shared-17.sentence-4" class="sentence">The write to <span class="texttt">expected</span> itself
is not required to be part of the atomic operation<a class="hidden_link" href="#util.smartptr.atomic.shared-17.sentence-4">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,compare_exchange_weak_"><div id="lib:compare_exchange_weak,atomic<shared_ptr<T>>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_weak,atomic%3cshared_ptr%3cT%3e%3e_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                           memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-18"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-18">18</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5253">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-18.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="codeblock"><span class="keyword">return</span> compare_exchange_weak<span class="parenthesis">(</span>expected, desired, order, fail_order<span class="parenthesis">)</span>;
</span>
where <span class="texttt">fail_<span class="shy"></span>order</span> is the same as <span class="texttt">order</span>
except that a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and
a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span><a class="hidden_link" href="#util.smartptr.atomic.shared-18.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,compare_exchange_strong_"><div id="lib:compare_exchange_strong,atomic<shared_ptr<T>>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_strong,atomic%3cshared_ptr%3cT%3e%3e_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                             memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-19"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-19">19</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5273">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-19.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="codeblock"><span class="keyword">return</span> compare_exchange_strong<span class="parenthesis">(</span>expected, desired, order, fail_order<span class="parenthesis">)</span>;
</span>
where <span class="texttt">fail_<span class="shy"></span>order</span> is the same as <span class="texttt">order</span>
except that a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and
a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span><a class="hidden_link" href="#util.smartptr.atomic.shared-19.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,wait"><div id="lib:wait,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:wait,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>shared_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-20"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-20">20</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5292">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-20.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.shared-20.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-21"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-21">21</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5300">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-21.sentence-1" class="sentence"><i>Effects</i>: Repeatedly performs the following steps, in order:
<ul class="itemize"><li id="util.smartptr.atomic.shared-21.1"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#util.smartptr.atomic.shared-21.1">(21.1)</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-21.1.sentence-1" class="sentence">Evaluates <span class="texttt">load<span class="parenthesis">(</span>order<span class="parenthesis">)</span></span> and compares it to <span class="texttt">old</span><a class="hidden_link" href="#util.smartptr.atomic.shared-21.1.sentence-1">.</a></div></div></li><li id="util.smartptr.atomic.shared-21.2"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#util.smartptr.atomic.shared-21.2">(21.2)</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-21.2.sentence-1" class="sentence">If the two are not equivalent, returns<a class="hidden_link" href="#util.smartptr.atomic.shared-21.2.sentence-1">.</a></div></div></li><li id="util.smartptr.atomic.shared-21.3"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#util.smartptr.atomic.shared-21.3">(21.3)</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-21.3.sentence-1" class="sentence">Blocks until it
  is unblocked by an atomic notifying operation or is unblocked spuriously<a class="hidden_link" href="#util.smartptr.atomic.shared-21.3.sentence-1">.</a></div></div></li></ul></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-22"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-22">22</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5313">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-22.sentence-1" class="sentence"><i>Remarks</i>: Two <span class="texttt">shared_<span class="shy"></span>ptr</span> objects are equivalent
if they store the same pointer and either share ownership or are both empty<a class="hidden_link" href="#util.smartptr.atomic.shared-22.sentence-1">.</a></div> <div id="util.smartptr.atomic.shared-22.sentence-2" class="sentence">This function is an atomic waiting operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#util.smartptr.atomic.shared-22.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,notify_one"><div id="lib:notify_one,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_one,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-23"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-23">23</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5326">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-23.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of at least one atomic waiting operation
that is eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call,
if any such atomic waiting operations exist<a class="hidden_link" href="#util.smartptr.atomic.shared-23.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-24"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-24">24</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5332">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-24.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#util.smartptr.atomic.shared-24.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<shared_ptr<T>>,notify_all"><div id="lib:notify_all,atomic<shared_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_all,atomic%3cshared_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-25"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-25">25</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5343">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-25.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of all atomic waiting operations
that are eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call<a class="hidden_link" href="#util.smartptr.atomic.shared-25.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.shared-26"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.shared-26">26</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5348">#</a></div><div class="texpara"><div id="util.smartptr.atomic.shared-26.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#util.smartptr.atomic.shared-26.sentence-1">.</a></div></div></div></div></div><div id="util.smartptr.atomic.weak" class="section"><h4><a class="secnum" href="#util.smartptr.atomic.weak" style="min-width:110pt">33.5.8.7.3</a> Partial specialization for <span class="texttt">weak_<span class="shy"></span>ptr</span> <a class="abbr_ref" href="util.smartptr.atomic.weak">[util.smartptr.atomic.weak]</a></h4><div class="texpara"><span id="lib:atomic<weak_ptr<T>>"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span> <span class="keyword">struct</span> atomic<span class="anglebracket">&lt;</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="anglebracket">&gt;</span> <span class="curlybracket">{</span>
    <span class="keyword">using</span> value_type <span class="operator">=</span> weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span>;

    <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> is_always_lock_free <span class="operator">=</span> <a class="index" id=":whether_a_given_atomic_type's_operations_are_always_lock_free______"></a><i>implementation-defined</i>;
    <span class="keyword">bool</span> is_lock_free<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;

    <span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span>atomic<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic<span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="added">constexpr </span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">operator</span> weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> exchange<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                         memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                               memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                                 memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                               memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                                 memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

  <span class="keyword">private</span><span class="operator">:</span>
    weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> p;              <span class="comment">// <i>exposition only</i></span>
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></span></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,constructor"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic%3cweak_ptr%3cT%3e%3e,constructor">🔗</a></div><code class="itemdeclcode"><span class="keyword">constexpr</span> atomic<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="util.smartptr.atomic.weak-1"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-1">1</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5401">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-1.sentence-1" class="sentence"><i>Effects</i>: Initializes <span class="texttt">p<span class="curlybracket">{</span><span class="curlybracket">}</span></span><a class="hidden_link" href="#util.smartptr.atomic.weak-1.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,constructor_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic%3cweak_ptr%3cT%3e%3e,constructor_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>atomic<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="util.smartptr.atomic.weak-2"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-2">2</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5412">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-2.sentence-1" class="sentence"><i>Effects</i>: Initializes the object with the value <span class="texttt">desired</span><a class="hidden_link" href="#util.smartptr.atomic.weak-2.sentence-1">.</a></div> <div id="util.smartptr.atomic.weak-2.sentence-2" class="sentence">Initialization is not an atomic operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#util.smartptr.atomic.weak-2.sentence-2">.</a></div> <div id="util.smartptr.atomic.weak-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#util.smartptr.atomic.weak-note-1">1</a></i>: <div id="util.smartptr.atomic.weak-2.sentence-3" class="sentence">It is possible to have an access to
an atomic object <span class="texttt">A</span> race with its construction,
for example,
by communicating the address of the just-constructed object <span class="texttt">A</span>
to another thread via <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span> operations
on a suitable atomic pointer variable, and
then immediately accessing <span class="texttt">A</span> in the receiving thread<a class="hidden_link" href="#util.smartptr.atomic.weak-2.sentence-3">.</a></div> <div id="util.smartptr.atomic.weak-2.sentence-4" class="sentence">This results in undefined behavior<a class="hidden_link" href="#util.smartptr.atomic.weak-2.sentence-4">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,store"><div id="lib:store,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:store,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> store<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-3"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-3">3</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5434">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-3.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.weak-3.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-4"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5441">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-4.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces the value pointed to by <span id=":this____________________"><span class="texttt"><span class="keyword">this</span></span></span> with
the value of <span class="texttt">desired</span> as if by <span class="texttt">p<span class="operator">.</span>swap<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.weak-4.sentence-1">.</a></div> <div id="util.smartptr.atomic.weak-4.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#util.smartptr.atomic.weak-4.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,operator="><div id="lib:operator=,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator=,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-5"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5454">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-5.sentence-1" class="sentence"><i>Effects</i>: Equivalent to <span class="texttt">store<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.weak-5.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,load"><div id="lib:load,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:load,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> load<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-6"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5465">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-6.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.weak-6.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-7"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5473">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-7.sentence-1" class="sentence"><i>Effects</i>: Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#util.smartptr.atomic.weak-7.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-8"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5477">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-8.sentence-1" class="sentence"><i>Returns</i>: Atomically returns <span class="texttt">p</span><a class="hidden_link" href="#util.smartptr.atomic.weak-8.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,operator_weak_ptr<T>"><div id="lib:operator_weak_ptr<T>,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:operator_weak_ptr%3cT%3e,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">operator</span> weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-9"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5488">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-9.sentence-1" class="sentence"><i>Effects</i>: Equivalent to: <span class="texttt"><span class="keyword">return</span> load<span class="parenthesis">(</span><span class="parenthesis">)</span>;</span></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,exchange"><div id="lib:exchange,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:exchange,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> exchange<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-10"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5499">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-10.sentence-1" class="sentence"><i>Effects</i>: Atomically replaces <span class="texttt">p</span> with <span class="texttt">desired</span>
as if by <span class="texttt">p<span class="operator">.</span>swap<span class="parenthesis">(</span>desired<span class="parenthesis">)</span></span><a class="hidden_link" href="#util.smartptr.atomic.weak-10.sentence-1">.</a></div> <div id="util.smartptr.atomic.weak-10.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#util.smartptr.atomic.weak-10.sentence-2">.</a></div> <div id="util.smartptr.atomic.weak-10.sentence-3" class="sentence">This is an atomic read-modify-write operation (<a href="intro.races" title="6.9.2.2 Data races">[intro.<span class="shy"></span>races]</a>)<a class="hidden_link" href="#util.smartptr.atomic.weak-10.sentence-3">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-11"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5506">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-11.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value of <span class="texttt">p</span> immediately before the effects<a class="hidden_link" href="#util.smartptr.atomic.weak-11.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,compare_exchange_weak"><div id="lib:compare_exchange_weak,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_weak,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                           memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                             memory_order success, memory_order failure<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-12"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-12">12</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5520">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-12.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">failure</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.weak-12.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-13"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-13">13</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5528">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-13.sentence-1" class="sentence"><i>Effects</i>: If <span class="texttt">p</span> is equivalent to <span class="texttt">expected</span>,
assigns <span class="texttt">desired</span> to <span class="texttt">p</span> and
has synchronization semantics corresponding to the value of <span class="texttt">success</span>,
otherwise assigns <span class="texttt">p</span> to <span class="texttt">expected</span> and
has synchronization semantics corresponding to the value of <span class="texttt">failure</span><a class="hidden_link" href="#util.smartptr.atomic.weak-13.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-14"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-14">14</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5536">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-14.sentence-1" class="sentence"><i>Returns</i>: <span class="texttt"><span class="literal">true</span></span> if <span class="texttt">p</span> was equivalent to <span class="texttt">expected</span>,
<span class="texttt"><span class="literal">false</span></span> otherwise<a class="hidden_link" href="#util.smartptr.atomic.weak-14.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-15"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-15">15</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5541">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-15.sentence-1" class="sentence"><i>Remarks</i>: Two <span class="texttt">weak_<span class="shy"></span>ptr</span> objects are equivalent if
they store the same pointer value and
either share ownership or are both empty<a class="hidden_link" href="#util.smartptr.atomic.weak-15.sentence-1">.</a></div> <div id="util.smartptr.atomic.weak-15.sentence-2" class="sentence">The weak form may fail spuriously<a class="hidden_link" href="#util.smartptr.atomic.weak-15.sentence-2">.</a></div> <div id="util.smartptr.atomic.weak-15.sentence-3" class="sentence">See <a href="#types.operations" title="33.5.8.2 Operations on atomic types">[atomics.<span class="shy"></span>types.<span class="shy"></span>operations]</a><a class="hidden_link" href="#util.smartptr.atomic.weak-15.sentence-3">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-16"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-16">16</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5548">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-16.sentence-1" class="sentence">If the operation returns <span class="texttt"><span class="literal">true</span></span>,
<span class="texttt">expected</span> is not accessed after the atomic update and
the operation is an atomic read-modify-write operation (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)
on the memory pointed to by <span id=":this_____________________"><span class="texttt"><span class="keyword">this</span></span></span><a class="hidden_link" href="#util.smartptr.atomic.weak-16.sentence-1">.</a></div> <div id="util.smartptr.atomic.weak-16.sentence-2" class="sentence">Otherwise, the operation is an atomic load operation on that memory, and
<span class="texttt">expected</span> is updated with the existing value
read from the atomic object in the attempted atomic update<a class="hidden_link" href="#util.smartptr.atomic.weak-16.sentence-2">.</a></div> <div id="util.smartptr.atomic.weak-16.sentence-3" class="sentence">The <span class="texttt">use_<span class="shy"></span>count</span> update corresponding to the write to <span class="texttt">expected</span>
is part of the atomic operation<a class="hidden_link" href="#util.smartptr.atomic.weak-16.sentence-3">.</a></div> <div id="util.smartptr.atomic.weak-16.sentence-4" class="sentence">The write to <span class="texttt">expected</span> itself
is not required to be part of the atomic operation<a class="hidden_link" href="#util.smartptr.atomic.weak-16.sentence-4">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,compare_exchange_weak_"><div id="lib:compare_exchange_weak,atomic<weak_ptr<T>>_"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_weak,atomic%3cweak_ptr%3cT%3e%3e_">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_weak<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                           memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-17"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-17">17</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5569">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-17.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="codeblock"><span class="keyword">return</span> compare_exchange_weak<span class="parenthesis">(</span>expected, desired, order, fail_order<span class="parenthesis">)</span>;
</span>
where <span class="texttt">fail_<span class="shy"></span>order</span> is the same as <span class="texttt">order</span>
except that a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and
a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span><a class="hidden_link" href="#util.smartptr.atomic.weak-17.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,compare_exchange_strong"><div id="lib:compare_exchange_strong,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:compare_exchange_strong,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">bool</span> compare_exchange_strong<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">&amp;</span> expected, weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> desired,
                             memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-18"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-18">18</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5589">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-18.sentence-1" class="sentence"><i>Effects</i>: Equivalent to:
<span class="codeblock"><span class="keyword">return</span> compare_exchange_strong<span class="parenthesis">(</span>expected, desired, order, fail_order<span class="parenthesis">)</span>;
</span>
where <span class="texttt">fail_<span class="shy"></span>order</span> is the same as <span class="texttt">order</span>
except that a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> and
a value of <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>
shall be replaced by the value <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span><a class="hidden_link" href="#util.smartptr.atomic.weak-18.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,wait"><div id="lib:wait,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:wait,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span>weak_ptr<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span> old, memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-19"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-19">19</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5608">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-19.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#util.smartptr.atomic.weak-19.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-20"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-20">20</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5616">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-20.sentence-1" class="sentence"><i>Effects</i>: Repeatedly performs the following steps, in order:
<ul class="itemize"><li id="util.smartptr.atomic.weak-20.1"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#util.smartptr.atomic.weak-20.1">(20.1)</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-20.1.sentence-1" class="sentence">Evaluates <span class="texttt">load<span class="parenthesis">(</span>order<span class="parenthesis">)</span></span> and compares it to <span class="texttt">old</span><a class="hidden_link" href="#util.smartptr.atomic.weak-20.1.sentence-1">.</a></div></div></li><li id="util.smartptr.atomic.weak-20.2"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#util.smartptr.atomic.weak-20.2">(20.2)</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-20.2.sentence-1" class="sentence">If the two are not equivalent, returns<a class="hidden_link" href="#util.smartptr.atomic.weak-20.2.sentence-1">.</a></div></div></li><li id="util.smartptr.atomic.weak-20.3"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#util.smartptr.atomic.weak-20.3">(20.3)</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-20.3.sentence-1" class="sentence">Blocks until it
  is unblocked by an atomic notifying operation or is unblocked spuriously<a class="hidden_link" href="#util.smartptr.atomic.weak-20.3.sentence-1">.</a></div></div></li></ul></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-21"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-21">21</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5629">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-21.sentence-1" class="sentence"><i>Remarks</i>: Two <span class="texttt">weak_<span class="shy"></span>ptr</span> objects are equivalent
if they store the same pointer and either share ownership or are both empty<a class="hidden_link" href="#util.smartptr.atomic.weak-21.sentence-1">.</a></div> <div id="util.smartptr.atomic.weak-21.sentence-2" class="sentence">This function is an atomic waiting operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#util.smartptr.atomic.weak-21.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,notify_one"><div id="lib:notify_one,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_one,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-22"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-22">22</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5643">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-22.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of at least one atomic waiting operation
that is eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call,
if any such atomic waiting operations exist<a class="hidden_link" href="#util.smartptr.atomic.weak-22.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-23"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-23">23</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5649">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-23.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#util.smartptr.atomic.weak-23.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic<weak_ptr<T>>,notify_all"><div id="lib:notify_all,atomic<weak_ptr<T>>"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:notify_all,atomic%3cweak_ptr%3cT%3e%3e">🔗</a></div><code class="itemdeclcode"><span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-24"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-24">24</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5660">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-24.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of all atomic waiting operations
that are eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call<a class="hidden_link" href="#util.smartptr.atomic.weak-24.sentence-1">.</a></div></div></div></div><div class="para" id="util.smartptr.atomic.weak-25"><div class="marginalizedparent"><a class="marginalized" href="#util.smartptr.atomic.weak-25">25</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5665">#</a></div><div class="texpara"><div id="util.smartptr.atomic.weak-25.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#util.smartptr.atomic.weak-25.sentence-1">.</a></div></div></div></div><div class="texpara"></div></div></div></div>
<div id="nonmembers" class="section"><h3><a class="secnum" href="#nonmembers" style="min-width:80pt">33.5.9</a> Non-member functions <a class="abbr_ref" href="atomics.nonmembers">[atomics.nonmembers]</a></h3><div class="para" id="nonmembers-1"><div class="marginalizedparent"><a class="marginalized" href="#nonmembers-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5673">#</a></div><div class="texpara"><div id="nonmembers-1.sentence-1" class="sentence">A non-member function template whose name matches the pattern
<span class="texttt">atomic_<span class="shy"></span><i>f</i></span> or the pattern <span class="texttt">atomic_<span class="shy"></span><i>f</i>_<span class="shy"></span>explicit</span>
invokes the member function <span class="texttt"><i>f</i></span>, with the value of the
first parameter as the object expression and the values of the remaining parameters
(if any) as the arguments of the member function call, in order<a class="hidden_link" href="#nonmembers-1.sentence-1">.</a></div> <div id="nonmembers-1.sentence-2" class="sentence">An argument
for a parameter of type <span class="texttt">atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span><span class="operator">​::​</span>value_<span class="shy"></span>type<span class="operator">*</span></span> is dereferenced when
passed to the member function call<a class="hidden_link" href="#nonmembers-1.sentence-2">.</a></div> <div id="nonmembers-1.sentence-3" class="sentence">If no such member function exists, the program is ill-formed<a class="hidden_link" href="#nonmembers-1.sentence-3">.</a></div></div></div><div class="para nonNormativeOnly" id="nonmembers-2"><div class="marginalizedparent"><a class="marginalized" href="#nonmembers-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5683">#</a></div><div class="texpara"><div id="nonmembers-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#nonmembers-note-1">1</a></i>: <div id="nonmembers-2.sentence-1" class="sentence">The non-member functions enable programmers to write code that can be
compiled as either C or C++, for example in a shared header file<a class="hidden_link" href="#nonmembers-2.sentence-1">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div>
<div id="flag" class="section"><h3><a class="secnum" href="#flag" style="min-width:80pt">33.5.10</a> Flag type and operations <a class="abbr_ref" href="atomics.flag">[atomics.flag]</a></h3><div class="texpara"><span class="codeblock"><span class="keyword">namespace</span> std <span class="curlybracket">{</span>
  <span class="keyword">struct</span> atomic_flag <span class="curlybracket">{</span>
    <span class="keyword">constexpr</span> atomic_flag<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    atomic_flag<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic_flag<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="operator">=</span> <span class="keyword">delete</span>;
    atomic_flag<span class="operator">&amp;</span> <span class="keyword">operator</span><span class="operator">=</span><span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">&amp;</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="operator">=</span> <span class="keyword">delete</span>;

    <span class="keyword">bool</span> test<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> test<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">bool</span> test_and_set<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">bool</span> test_and_set<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> clear<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> clear<span class="parenthesis">(</span>memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;

    <span class="keyword">void</span> wait<span class="parenthesis">(</span><span class="keyword">bool</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> wait<span class="parenthesis">(</span><span class="keyword">bool</span>, memory_order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
    <span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
    <span class="added">constexpr </span><span class="keyword">void</span> notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
  <span class="curlybracket">}</span>;
<span class="curlybracket">}</span>
</span></div><div class="para" id="flag-1"><div class="marginalizedparent"><a class="marginalized" href="#flag-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5716">#</a></div><div class="texpara"><div id="flag-1.sentence-1" class="sentence">The <span class="texttt">atomic_<span class="shy"></span>flag</span> type provides the classic test-and-set functionality<a class="hidden_link" href="#flag-1.sentence-1">.</a></div> <div id="flag-1.sentence-2" class="sentence">It has two states, set and clear<a class="hidden_link" href="#flag-1.sentence-2">.</a></div></div></div><div class="para" id="flag-2"><div class="marginalizedparent"><a class="marginalized" href="#flag-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5719">#</a></div><div class="texpara"><div id="flag-2.sentence-1" class="sentence">Operations on an object of type <span class="texttt">atomic_<span class="shy"></span>flag</span> shall be lock-free<a class="hidden_link" href="#flag-2.sentence-1">.</a></div> <div id="flag-2.sentence-2" class="sentence">The operations should also be address-free<a class="hidden_link" href="#flag-2.sentence-2">.</a></div></div></div><div class="para" id="flag-3"><div class="marginalizedparent"><a class="marginalized" href="#flag-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5723">#</a></div><div class="texpara"><div id="flag-3.sentence-1" class="sentence">The <span class="texttt">atomic_<span class="shy"></span>flag</span> type is a standard-layout struct<a class="hidden_link" href="#flag-3.sentence-1">.</a></div> <div id="flag-3.sentence-2" class="sentence">It has a trivial destructor<a class="hidden_link" href="#flag-3.sentence-2">.</a></div></div></div><div class="texpara"><div id="lib:atomic_flag,constructor"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_flag,constructor">🔗</a></div><code class="itemdeclcode"><span class="keyword">constexpr</span> atomic_flag<span class="operator">::</span>atomic_flag<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="flag-4"><div class="marginalizedparent"><a class="marginalized" href="#flag-4">4</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5733">#</a></div><div class="texpara"><div id="flag-4.sentence-1" class="sentence"><i>Effects</i>: Initializes <span class="texttt"><span class="operator">*</span><span class="keyword">this</span></span> to the clear state<a class="hidden_link" href="#flag-4.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_flag,test"><div id="lib:test,atomic_flag"><div id="lib:atomic_flag_test_explicit"><div id="lib:atomic_flag_test"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_flag_test">🔗</a></div><code class="itemdeclcode"><span class="keyword">bool</span> atomic_flag_test<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> atomic_flag_test_explicit<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object,
                               memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test_explicit<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span> object,
                               memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> atomic_flag<span class="operator">::</span>test<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag<span class="operator">::</span>test<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="flag-5"><div class="marginalizedparent"><a class="marginalized" href="#flag-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5753">#</a></div><div class="texpara"><div id="flag-5.sentence-1" class="sentence">For <span class="texttt">atomic_<span class="shy"></span>flag_<span class="shy"></span>test</span>, let <span class="texttt">order</span> be <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#flag-5.sentence-1">.</a></div></div></div></div><div class="para" id="flag-6"><div class="marginalizedparent"><a class="marginalized" href="#flag-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5756">#</a></div><div class="texpara"><div id="flag-6.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#flag-6.sentence-1">.</a></div></div></div></div><div class="para" id="flag-7"><div class="marginalizedparent"><a class="marginalized" href="#flag-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5764">#</a></div><div class="texpara"><div id="flag-7.sentence-1" class="sentence"><i>Effects</i>: Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#flag-7.sentence-1">.</a></div></div></div></div><div class="para" id="flag-8"><div class="marginalizedparent"><a class="marginalized" href="#flag-8">8</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5768">#</a></div><div class="texpara"><div id="flag-8.sentence-1" class="sentence"><i>Returns</i>: Atomically returns the value pointed to by <span class="texttt">object</span> or <span id=":this______________________"><span class="texttt"><span class="keyword">this</span></span></span><a class="hidden_link" href="#flag-8.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_flag,test_and_set"><div id="lib:test_and_set,atomic_flag"><div id="lib:atomic_flag_test_and_set_explicit"><div id="lib:atomic_flag_test_and_set"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_flag_test_and_set">🔗</a></div><code class="itemdeclcode"><span class="keyword">bool</span> atomic_flag_test_and_set<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test_and_set<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> atomic_flag_test_and_set_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object, memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag_test_and_set_explicit<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span> object, memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">bool</span> atomic_flag<span class="operator">::</span>test_and_set<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">bool</span> atomic_flag<span class="operator">::</span>test_and_set<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="flag-9"><div class="marginalizedparent"><a class="marginalized" href="#flag-9">9</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5786">#</a></div><div class="texpara"><div id="flag-9.sentence-1" class="sentence"><i>Effects</i>: Atomically sets the value pointed to by <span class="texttt">object</span> or by <span id=":this_______________________"><span class="texttt"><span class="keyword">this</span></span></span> to <span class="texttt"><span class="literal">true</span></span><a class="hidden_link" href="#flag-9.sentence-1">.</a></div> <div id="flag-9.sentence-2" class="sentence">Memory is affected according to the value of
<span class="texttt">order</span><a class="hidden_link" href="#flag-9.sentence-2">.</a></div> <div id="flag-9.sentence-3" class="sentence">These operations are atomic read-modify-write operations (<a href="intro.multithread" title="6.9.2 Multi-threaded executions and data races">[intro.<span class="shy"></span>multithread]</a>)<a class="hidden_link" href="#flag-9.sentence-3">.</a></div></div></div></div><div class="para" id="flag-10"><div class="marginalizedparent"><a class="marginalized" href="#flag-10">10</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5791">#</a></div><div class="texpara"><div id="flag-10.sentence-1" class="sentence"><i>Returns</i>: Atomically, the value of the object immediately before the effects<a class="hidden_link" href="#flag-10.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_flag,clear"><div id="lib:clear,atomic_flag"><div id="lib:atomic_flag_clear_explicit"><div id="lib:atomic_flag_clear"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_flag_clear">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> atomic_flag_clear<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_clear<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">void</span> atomic_flag_clear_explicit<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object, memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_clear_explicit<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span> object, memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">void</span> atomic_flag<span class="operator">::</span>clear<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag<span class="operator">::</span>clear<span class="parenthesis">(</span>memory_order order <span class="operator">=</span> memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="flag-11"><div class="marginalizedparent"><a class="marginalized" href="#flag-11">11</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5809">#</a></div><div class="texpara"><div id="flag-11.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#flag-11.sentence-1">.</a></div></div></div></div><div class="para" id="flag-12"><div class="marginalizedparent"><a class="marginalized" href="#flag-12">12</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5816">#</a></div><div class="texpara"><div id="flag-12.sentence-1" class="sentence"><i>Effects</i>: Atomically sets the value pointed to by <span class="texttt">object</span> or by <span id=":this________________________"><span class="texttt"><span class="keyword">this</span></span></span> to
<span class="texttt"><span class="literal">false</span></span><a class="hidden_link" href="#flag-12.sentence-1">.</a></div> <div id="flag-12.sentence-2" class="sentence">Memory is affected according to the value of <span class="texttt">order</span><a class="hidden_link" href="#flag-12.sentence-2">.</a></div></div></div></div><div class="texpara"><div id="lib:atomic_flag,wait"><div id="lib:wait,atomic_flag"><div id="lib:atomic_flag_wait_explicit"><div id="lib:atomic_flag_wait"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_flag_wait">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> atomic_flag_wait<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object, <span class="keyword">bool</span> old<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_wait<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span> object, <span class="keyword">bool</span> old<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">void</span> atomic_flag_wait_explicit<span class="parenthesis">(</span><span class="keyword">const</span> <span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object,
                               <span class="keyword">bool</span> old, memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_wait_explicit<span class="parenthesis">(</span><span class="keyword">const</span> atomic_flag<span class="operator">*</span> object,
                               <span class="keyword">bool</span> old, memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">void</span> atomic_flag<span class="operator">::</span>wait<span class="parenthesis">(</span><span class="keyword">bool</span> old, memory_order order <span class="operator">=</span>
                                   memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag<span class="operator">::</span>wait<span class="parenthesis">(</span><span class="keyword">bool</span> old, memory_order order <span class="operator">=</span>
                                   memory_order<span class="operator">::</span>seq_cst<span class="parenthesis">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span>;
</code></div></div></div></div></div></div><div class="para" id="flag-13"><div class="marginalizedparent"><a class="marginalized" href="#flag-13">13</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5839">#</a></div><div class="texpara"><div id="flag-13.sentence-1" class="sentence">For <span class="texttt">atomic_<span class="shy"></span>flag_<span class="shy"></span>wait</span>,
let <span class="texttt">order</span> be <span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#flag-13.sentence-1">.</a></div> <div id="flag-13.sentence-2" class="sentence">Let <span class="texttt">flag</span> be <span class="texttt">object</span> for the non-member functions and
<span id=":this_________________________"><span class="texttt"><span class="keyword">this</span></span></span> for the member functions<a class="hidden_link" href="#flag-13.sentence-2">.</a></div></div></div></div><div class="para" id="flag-14"><div class="marginalizedparent"><a class="marginalized" href="#flag-14">14</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5845">#</a></div><div class="texpara"><div id="flag-14.sentence-1" class="sentence"><i>Preconditions</i>: <span class="texttt">order</span> is
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>,
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>ac<span class="operator">-</span><br>quire</span>, or
<span class="texttt">memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#flag-14.sentence-1">.</a></div></div></div></div><div class="para" id="flag-15"><div class="marginalizedparent"><a class="marginalized" href="#flag-15">15</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5853">#</a></div><div class="texpara"><div id="flag-15.sentence-1" class="sentence"><i>Effects</i>: Repeatedly performs the following steps, in order:
<ul class="itemize"><li id="flag-15.1"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#flag-15.1">(15.1)</a></div><div class="texpara"><div id="flag-15.1.sentence-1" class="sentence">Evaluates <span class="texttt">flag<span class="operator">-</span><span class="anglebracket">&gt;</span>test<span class="parenthesis">(</span>order<span class="parenthesis">)</span> <span class="operator">!</span><span class="operator">=</span> old</span><a class="hidden_link" href="#flag-15.1.sentence-1">.</a></div></div></li><li id="flag-15.2"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#flag-15.2">(15.2)</a></div><div class="texpara"><div id="flag-15.2.sentence-1" class="sentence">If the result of that evaluation is <span class="texttt"><span class="literal">true</span></span>, returns<a class="hidden_link" href="#flag-15.2.sentence-1">.</a></div></div></li><li id="flag-15.3"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#flag-15.3">(15.3)</a></div><div class="texpara"><div id="flag-15.3.sentence-1" class="sentence">Blocks until it
  is unblocked by an atomic notifying operation or is unblocked spuriously<a class="hidden_link" href="#flag-15.3.sentence-1">.</a></div></div></li></ul></div></div></div></div><div class="para" id="flag-16"><div class="marginalizedparent"><a class="marginalized" href="#flag-16">16</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5866">#</a></div><div class="texpara"><div id="flag-16.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic waiting operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#flag-16.sentence-1">.</a></div></div></div></div><div class="texpara"><div class="itemdecl" id="flag-itemdecl:6"><div class="marginalizedparent"><a class="itemDeclLink" href="#flag-itemdecl:6">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> atomic_flag_notify_one<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_notify_one<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">void</span> atomic_flag<span class="operator">::</span>notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag<span class="operator">::</span>notify_one<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div><div class="para" id="flag-17"><div class="marginalizedparent"><a class="marginalized" href="#flag-17">17</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5879">#</a></div><div class="texpara"><div id="flag-17.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of at least one atomic waiting operation
that is eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call,
if any such atomic waiting operations exist<a class="hidden_link" href="#flag-17.sentence-1">.</a></div></div></div></div><div class="para" id="flag-18"><div class="marginalizedparent"><a class="marginalized" href="#flag-18">18</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5885">#</a></div><div class="texpara"><div id="flag-18.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#flag-18.sentence-1">.</a></div></div></div></div><div class="texpara"><div class="itemdecl" id="flag-itemdecl:7"><div class="marginalizedparent"><a class="itemDeclLink" href="#flag-itemdecl:7">🔗</a></div><code class="itemdeclcode"><span class="keyword">void</span> atomic_flag_notify_all<span class="parenthesis">(</span><span class="keyword">volatile</span> atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag_notify_all<span class="parenthesis">(</span>atomic_flag<span class="operator">*</span> object<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
<span class="keyword">void</span> atomic_flag<span class="operator">::</span>notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">volatile</span> <span class="keyword">noexcept</span>;
<span class="added">constexpr </span><span class="keyword">void</span> atomic_flag<span class="operator">::</span>notify_all<span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div><div class="para" id="flag-19"><div class="marginalizedparent"><a class="marginalized" href="#flag-19">19</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5898">#</a></div><div class="texpara"><div id="flag-19.sentence-1" class="sentence"><i>Effects</i>: Unblocks the execution of all atomic waiting operations
that are eligible to be unblocked (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>) by this call<a class="hidden_link" href="#flag-19.sentence-1">.</a></div></div></div></div><div class="para" id="flag-20"><div class="marginalizedparent"><a class="marginalized" href="#flag-20">20</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5903">#</a></div><div class="texpara"><div id="flag-20.sentence-1" class="sentence"><i>Remarks</i>: This function is an atomic notifying operation (<a href="#wait" title="33.5.6 Waiting and notifying">[atomics.<span class="shy"></span>wait]</a>)<a class="hidden_link" href="#flag-20.sentence-1">.</a></div></div></div></div><div class="texpara"><div id="lib:ATOMIC_FLAG_INIT"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:ATOMIC_FLAG_INIT">🔗</a></div><code class="itemdeclcode"><span class="preprocessordirective">#define</span> ATOMIC_FLAG_INIT <i><span class="texttt">see below</span></i>
</code></div></div></div><div class="para" id="flag-21"><div class="marginalizedparent"><a class="marginalized" href="#flag-21">21</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5914">#</a></div><div class="texpara"><div id="flag-21.sentence-1" class="sentence"><i>Remarks</i>: The macro <span class="texttt">ATOMIC_<span class="shy"></span>FLAG_<span class="shy"></span>INIT</span> is defined in such a way that
it can be used to initialize an object of type <span class="texttt">atomic_<span class="shy"></span>flag</span>
to the clear state<a class="hidden_link" href="#flag-21.sentence-1">.</a></div> <div id="flag-21.sentence-2" class="sentence">The macro can be used in the form:
<span class="codeblock">atomic_flag guard <span class="operator">=</span> ATOMIC_FLAG_INIT;
</span></div> <div id="flag-21.sentence-3" class="sentence">
It is unspecified whether the macro can be used
in other initialization contexts<a class="hidden_link" href="#flag-21.sentence-3">.</a></div> <div id="flag-21.sentence-4" class="sentence">For a complete static-duration object, that initialization shall be static<a class="hidden_link" href="#flag-21.sentence-4">.</a></div></div></div></div></div>
<div id="fences" class="section"><h3><a class="secnum" href="#fences" style="min-width:80pt">33.5.11</a> Fences <a class="abbr_ref" href="atomics.fences">[atomics.fences]</a></h3><div class="para" id="fences-1"><div class="marginalizedparent"><a class="marginalized" href="#fences-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5930">#</a></div><div class="texpara"><div id="fences-1.sentence-1" class="sentence">This subclause introduces synchronization primitives called <a class="hidden_link" href="#def:fences" id="def:fences"><i>fences</i></a><a class="hidden_link" href="#fences-1.sentence-1">.</a></div> <div id="fences-1.sentence-2" class="sentence">Fences can have
acquire semantics, release semantics, or both<a class="hidden_link" href="#fences-1.sentence-2">.</a></div> <div id="fences-1.sentence-3" class="sentence">A fence with acquire semantics is called
an <a class="hidden_link" href="#def:acquire_fence" id="def:acquire_fence"><i>acquire fence</i></a><a class="hidden_link" href="#fences-1.sentence-3">.</a></div> <div id="fences-1.sentence-4" class="sentence">A fence with release semantics is called a <a class="hidden_link" href="#def:release_fence" id="def:release_fence"><i>release
fence</i></a><a class="hidden_link" href="#fences-1.sentence-4">.</a></div></div></div><div class="para" id="fences-2"><div class="marginalizedparent"><a class="marginalized" href="#fences-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5936">#</a></div><div class="texpara"><div id="fences-2.sentence-1" class="sentence">A release fence <span class="math"><span class="mathalpha">A</span></span> synchronizes with an acquire fence <span class="math"><span class="mathalpha">B</span></span> if there exist
atomic operations <span class="math"><span class="mathalpha">X</span></span> and <span class="math"><span class="mathalpha">Y</span></span>, both operating on some atomic object
<span class="math"><span class="mathalpha">M</span></span>, such that <span class="math"><span class="mathalpha">A</span></span> is sequenced before <span class="math"><span class="mathalpha">X</span></span>, <span class="math"><span class="mathalpha">X</span></span> modifies
<span class="math"><span class="mathalpha">M</span></span>, <span class="math"><span class="mathalpha">Y</span></span> is sequenced before <span class="math"><span class="mathalpha">B</span></span>, and <span class="math"><span class="mathalpha">Y</span></span> reads the value
written by <span class="math"><span class="mathalpha">X</span></span> or a value written by any side effect in the hypothetical release
sequence <span class="math"><span class="mathalpha">X</span></span> would head if it were a release operation<a class="hidden_link" href="#fences-2.sentence-1">.</a></div></div></div><div class="para" id="fences-3"><div class="marginalizedparent"><a class="marginalized" href="#fences-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5944">#</a></div><div class="texpara"><div id="fences-3.sentence-1" class="sentence">A release fence <span class="math"><span class="mathalpha">A</span></span> synchronizes with an atomic operation <span class="math"><span class="mathalpha">B</span></span> that
performs an acquire operation on an atomic object <span class="math"><span class="mathalpha">M</span></span> if there exists an atomic
operation <span class="math"><span class="mathalpha">X</span></span> such that <span class="math"><span class="mathalpha">A</span></span> is sequenced before <span class="math"><span class="mathalpha">X</span></span>, <span class="math"><span class="mathalpha">X</span></span>
modifies <span class="math"><span class="mathalpha">M</span></span>, and <span class="math"><span class="mathalpha">B</span></span> reads the value written by <span class="math"><span class="mathalpha">X</span></span> or a value
written by any side effect in the hypothetical release sequence <span class="math"><span class="mathalpha">X</span></span> would head if
it were a release operation<a class="hidden_link" href="#fences-3.sentence-1">.</a></div></div></div><div class="para" id="fences-4"><div class="marginalizedparent"><a class="marginalized" href="#fences-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5952">#</a></div><div class="texpara"><div id="fences-4.sentence-1" class="sentence">An atomic operation <span class="math"><span class="mathalpha">A</span></span> that is a release operation on an atomic object
<span class="math"><span class="mathalpha">M</span></span> synchronizes with an acquire fence <span class="math"><span class="mathalpha">B</span></span> if there exists some atomic
operation <span class="math"><span class="mathalpha">X</span></span> on <span class="math"><span class="mathalpha">M</span></span> such that <span class="math"><span class="mathalpha">X</span></span> is sequenced before <span class="math"><span class="mathalpha">B</span></span>
and reads the value written by <span class="math"><span class="mathalpha">A</span></span> or a value written by any side effect in the
release sequence headed by <span class="math"><span class="mathalpha">A</span></span><a class="hidden_link" href="#fences-4.sentence-1">.</a></div></div></div><div class="texpara"><div id="lib:atomic_thread_fence"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_thread_fence">🔗</a></div><code class="itemdeclcode"><span class="keyword">extern</span> <span class="literal">"C"</span> <span class="added">constexpr </span><span class="keyword">void</span> atomic_thread_fence<span class="parenthesis">(</span>memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="fences-5"><div class="marginalizedparent"><a class="marginalized" href="#fences-5">5</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5965">#</a></div><div class="texpara"><div id="fences-5.sentence-1" class="sentence"><i>Effects</i>: Depending on the value of <span class="texttt">order</span>, this operation:
<ul class="itemize"><li id="fences-5.1"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#fences-5.1">(5.1)</a></div>has no effects, if <span class="texttt">order <span class="operator">=</span><span class="operator">=</span> memory_<span class="shy"></span>order<span class="operator">​::​</span>relaxed</span>;</li><li id="fences-5.2"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#fences-5.2">(5.2)</a></div>is an acquire fence, if <span class="texttt">order <span class="operator">=</span><span class="operator">=</span> memory_<span class="shy"></span>order<span class="operator">​::​</span>acquire</span> or <span class="texttt">order <span class="operator">=</span><span class="operator">=</span> memory_<span class="shy"></span>order<span class="operator">​::​</span>consume</span>;</li><li id="fences-5.3"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#fences-5.3">(5.3)</a></div>is a release fence, if <span class="texttt">order <span class="operator">=</span><span class="operator">=</span> memory_<span class="shy"></span>order<span class="operator">​::​</span>release</span>;</li><li id="fences-5.4"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#fences-5.4">(5.4)</a></div>is both an acquire fence and a release fence, if <span class="texttt">order <span class="operator">=</span><span class="operator">=</span> memory_<span class="shy"></span>order<span class="operator">​::​</span>acq_<span class="shy"></span>rel</span>;</li><li id="fences-5.5"><div class="marginalizedparent" style="left:-39mm"><a class="marginalized" href="#fences-5.5">(5.5)</a></div>is a sequentially consistent acquire and release fence, if <span class="texttt">order <span class="operator">=</span><span class="operator">=</span> memory_<span class="shy"></span>order<span class="operator">​::​</span>seq_<span class="shy"></span>cst</span><a class="hidden_link" href="#fences-5.sentence-1">.</a></li></ul></div></div></div></div><div class="texpara"><div id="lib:atomic_signal_fence"><div class="itemdecl"><div class="marginalizedparent"><a class="itemDeclLink" href="#lib:atomic_signal_fence">🔗</a></div><code class="itemdeclcode"><span class="keyword">extern</span> <span class="literal">"C"</span> <span class="added">constexpr </span><span class="keyword">void</span> atomic_signal_fence<span class="parenthesis">(</span>memory_order order<span class="parenthesis">)</span> <span class="keyword">noexcept</span>;
</code></div></div></div><div class="para" id="fences-6"><div class="marginalizedparent"><a class="marginalized" href="#fences-6">6</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5987">#</a></div><div class="texpara"><div id="fences-6.sentence-1" class="sentence"><i>Effects</i>: Equivalent to <span class="texttt">atomic_<span class="shy"></span>thread_<span class="shy"></span>fence<span class="parenthesis">(</span>order<span class="parenthesis">)</span></span>, except that
the resulting ordering constraints are established only between a thread and a
signal handler executed in the same thread<a class="hidden_link" href="#fences-6.sentence-1">.</a></div></div></div></div><div class="para nonNormativeOnly" id="fences-7"><div class="marginalizedparent"><a class="marginalized" href="#fences-7">7</a></div><div class="itemdescr"><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L5993">#</a></div><div class="texpara"><div id="fences-note-1" class="note"><div class="texpara">[<i>Note&nbsp;<a href="#fences-note-1">1</a></i>: <div id="fences-7.sentence-1" class="sentence"><span class="texttt">atomic_<span class="shy"></span>signal_<span class="shy"></span>fence</span> can be used to specify the order in which actions
performed by the thread become visible to the signal handler<a class="hidden_link" href="#fences-7.sentence-1">.</a></div> <div id="fences-7.sentence-2" class="sentence">Compiler optimizations and reorderings of loads and stores are inhibited in
the same way as with <span class="texttt">atomic_<span class="shy"></span>thread_<span class="shy"></span>fence</span>, but the hardware fence instructions
that <span class="texttt">atomic_<span class="shy"></span>thread_<span class="shy"></span>fence</span> would have inserted are not emitted<a class="hidden_link" href="#fences-7.sentence-2">.</a></div> —&nbsp;<i>end note</i>]</div></div></div></div></div></div>
<div id="stdatomic.h.syn" class="section"><h3><a class="secnum" href="#stdatomic.h.syn" style="min-width:80pt">33.5.12</a> C compatibility <a class="abbr_ref" href="stdatomic.h.syn">[stdatomic.h.syn]</a></h3><div class="texpara"><div id="stdatomic.h.syn-sentence-1" class="sentence">The header <span id="header:<stdatomic.h>"><span class="texttt"><span class="anglebracket">&lt;</span>stdatomic<span class="operator">.</span>h<span class="anglebracket">&gt;</span></span></span> provides the following definitions:</div></div><div class="texpara"><span class="codeblock"><span class="keyword">template</span><span class="anglebracket">&lt;</span><span class="keyword">class</span> T<span class="anglebracket">&gt;</span>
  <span class="keyword">using</span> <i>std-atomic</i> <span class="operator">=</span> std<span class="operator">::</span>atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span>;        <span class="comment">// <i>exposition only</i></span>

<span class="preprocessordirective">#define</span> _Atomic<span class="parenthesis">(</span>T<span class="parenthesis">)</span> <i>std-atomic</i><span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span>

<span class="preprocessordirective">#define</span> ATOMIC_BOOL_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR16_T_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_CHAR32_T_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_WCHAR_T_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_SHORT_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_INT_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_LONG_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_LLONG_LOCK_FREE <i><span class="texttt">see below</span></i>
<span class="preprocessordirective">#define</span> ATOMIC_POINTER_LOCK_FREE <i><span class="texttt">see below</span></i>

<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_"><a class="hidden_link" href="#lib:memory_order" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order</a></span>;             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_relaxed_"><a class="hidden_link" href="#lib:memory_order_relaxed" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order_relaxed</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_consume_"><a class="hidden_link" href="#lib:memory_order_consume" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order_consume</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_acquire_"><a class="hidden_link" href="#lib:memory_order_acquire" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order_acquire</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_release_"><a class="hidden_link" href="#lib:memory_order_release" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order_release</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_acq_rel_"><a class="hidden_link" href="#lib:memory_order_acq_rel" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order_acq_rel</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:memory_order_seq_cst_"><a class="hidden_link" href="#lib:memory_order_seq_cst" title="33.5.12 C compatibility [stdatomic.h.syn]">memory_order_seq_cst</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>

<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_flag"><a class="hidden_link" href="#lib:atomic_flag" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_flag</a></span>;              <span class="comment">// <i><span class="texttt">see below</span></i></span>

<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_bool_"><a class="hidden_link" href="#lib:atomic_bool" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_bool</a></span>;              <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_char_"><a class="hidden_link" href="#lib:atomic_char" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_char</a></span>;              <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_schar_"><a class="hidden_link" href="#lib:atomic_schar" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_schar</a></span>;             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uchar_"><a class="hidden_link" href="#lib:atomic_uchar" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uchar</a></span>;             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_short_"><a class="hidden_link" href="#lib:atomic_short" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_short</a></span>;             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_ushort_"><a class="hidden_link" href="#lib:atomic_ushort" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_ushort</a></span>;            <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_"><a class="hidden_link" href="#lib:atomic_int" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int</a></span>;               <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_"><a class="hidden_link" href="#lib:atomic_uint" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint</a></span>;              <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_long_"><a class="hidden_link" href="#lib:atomic_long" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_long</a></span>;              <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_ulong_"><a class="hidden_link" href="#lib:atomic_ulong" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_ulong</a></span>;             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_llong_"><a class="hidden_link" href="#lib:atomic_llong" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_llong</a></span>;             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_ullong_"><a class="hidden_link" href="#lib:atomic_ullong" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_ullong</a></span>;            <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_char8_t_"><a class="hidden_link" href="#lib:atomic_char8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_char8_t</a></span>;           <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_char16_t_"><a class="hidden_link" href="#lib:atomic_char16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_char16_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_char32_t_"><a class="hidden_link" href="#lib:atomic_char32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_char32_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_wchar_t_"><a class="hidden_link" href="#lib:atomic_wchar_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_wchar_t</a></span>;           <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int8_t_"><a class="hidden_link" href="#lib:atomic_int8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int8_t</a></span>;            <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint8_t_"><a class="hidden_link" href="#lib:atomic_uint8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint8_t</a></span>;           <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int16_t_"><a class="hidden_link" href="#lib:atomic_int16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int16_t</a></span>;           <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint16_t_"><a class="hidden_link" href="#lib:atomic_uint16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint16_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int32_t_"><a class="hidden_link" href="#lib:atomic_int32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int32_t</a></span>;           <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint32_t_"><a class="hidden_link" href="#lib:atomic_uint32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint32_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int64_t_"><a class="hidden_link" href="#lib:atomic_int64_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int64_t</a></span>;           <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint64_t_"><a class="hidden_link" href="#lib:atomic_uint64_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint64_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_least8_t_"><a class="hidden_link" href="#lib:atomic_int_least8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_least8_t</a></span>;      <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_least8_t_"><a class="hidden_link" href="#lib:atomic_uint_least8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_least8_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_least16_t_"><a class="hidden_link" href="#lib:atomic_int_least16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_least16_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_least16_t_"><a class="hidden_link" href="#lib:atomic_uint_least16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_least16_t</a></span>;    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_least32_t_"><a class="hidden_link" href="#lib:atomic_int_least32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_least32_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_least32_t_"><a class="hidden_link" href="#lib:atomic_uint_least32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_least32_t</a></span>;    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_least64_t_"><a class="hidden_link" href="#lib:atomic_int_least64_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_least64_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_least64_t_"><a class="hidden_link" href="#lib:atomic_uint_least64_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_least64_t</a></span>;    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_fast8_t_"><a class="hidden_link" href="#lib:atomic_int_fast8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_fast8_t</a></span>;       <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_fast8_t_"><a class="hidden_link" href="#lib:atomic_uint_fast8_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_fast8_t</a></span>;      <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_fast16_t_"><a class="hidden_link" href="#lib:atomic_int_fast16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_fast16_t</a></span>;      <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_fast16_t_"><a class="hidden_link" href="#lib:atomic_uint_fast16_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_fast16_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_fast32_t_"><a class="hidden_link" href="#lib:atomic_int_fast32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_fast32_t</a></span>;      <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_fast32_t_"><a class="hidden_link" href="#lib:atomic_uint_fast32_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_fast32_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_int_fast64_t_"><a class="hidden_link" href="#lib:atomic_int_fast64_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_int_fast64_t</a></span>;      <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uint_fast64_t_"><a class="hidden_link" href="#lib:atomic_uint_fast64_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uint_fast64_t</a></span>;     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_intptr_t_"><a class="hidden_link" href="#lib:atomic_intptr_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_intptr_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uintptr_t_"><a class="hidden_link" href="#lib:atomic_uintptr_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uintptr_t</a></span>;         <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_size_t_"><a class="hidden_link" href="#lib:atomic_size_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_size_t</a></span>;            <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_ptrdiff_t_"><a class="hidden_link" href="#lib:atomic_ptrdiff_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_ptrdiff_t</a></span>;         <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_intmax_t_"><a class="hidden_link" href="#lib:atomic_intmax_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_intmax_t</a></span>;          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_uintmax_t_"><a class="hidden_link" href="#lib:atomic_uintmax_t" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_uintmax_t</a></span>;         <span class="comment">// <i><span class="texttt">see below</span></i></span>

<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_is_lock_free_"><a class="hidden_link" href="#lib:atomic_is_lock_free" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_is_lock_free</a></span>;                          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_load_"><a class="hidden_link" href="#lib:atomic_load" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_load</a></span>;                                  <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_load_explicit_"><a class="hidden_link" href="#lib:atomic_load_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_load_explicit</a></span>;                         <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_store_"><a class="hidden_link" href="#lib:atomic_store" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_store</a></span>;                                 <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_store_explicit_"><a class="hidden_link" href="#lib:atomic_store_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_store_explicit</a></span>;                        <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_exchange_"><a class="hidden_link" href="#lib:atomic_exchange" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_exchange</a></span>;                              <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_exchange_explicit_"><a class="hidden_link" href="#lib:atomic_exchange_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_exchange_explicit</a></span>;                     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_compare_exchange_strong_"><a class="hidden_link" href="#lib:atomic_compare_exchange_strong" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_compare_exchange_strong</a></span>;               <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_compare_exchange_strong_explicit_"><a class="hidden_link" href="#lib:atomic_compare_exchange_strong_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_compare_exchange_strong_explicit</a></span>;      <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_compare_exchange_weak_"><a class="hidden_link" href="#lib:atomic_compare_exchange_weak" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_compare_exchange_weak</a></span>;                 <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_compare_exchange_weak_explicit_"><a class="hidden_link" href="#lib:atomic_compare_exchange_weak_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_compare_exchange_weak_explicit</a></span>;        <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_add___"><a class="hidden_link" href="#lib:atomic_fetch_add" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_add</a></span>;                             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_add_explicit___"><a class="hidden_link" href="#lib:atomic_fetch_add_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_add_explicit</a></span>;                    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_sub___"><a class="hidden_link" href="#lib:atomic_fetch_sub" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_sub</a></span>;                             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_sub_explicit___"><a class="hidden_link" href="#lib:atomic_fetch_sub_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_sub_explicit</a></span>;                    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_and_"><a class="hidden_link" href="#lib:atomic_fetch_and" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_and</a></span>;                             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_and_explicit_"><a class="hidden_link" href="#lib:atomic_fetch_and_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_and_explicit</a></span>;                    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_or_"><a class="hidden_link" href="#lib:atomic_fetch_or" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_or</a></span>;                              <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_or_explicit_"><a class="hidden_link" href="#lib:atomic_fetch_or_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_or_explicit</a></span>;                     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_xor_"><a class="hidden_link" href="#lib:atomic_fetch_xor" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_xor</a></span>;                             <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_fetch_xor_explicit_"><a class="hidden_link" href="#lib:atomic_fetch_xor_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_fetch_xor_explicit</a></span>;                    <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_flag_test_and_set_"><a class="hidden_link" href="#lib:atomic_flag_test_and_set" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_flag_test_and_set</a></span>;                     <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_flag_test_and_set_explicit_"><a class="hidden_link" href="#lib:atomic_flag_test_and_set_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_flag_test_and_set_explicit</a></span>;            <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_flag_clear_"><a class="hidden_link" href="#lib:atomic_flag_clear" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_flag_clear</a></span>;                            <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_flag_clear_explicit_"><a class="hidden_link" href="#lib:atomic_flag_clear_explicit" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_flag_clear_explicit</a></span>;                   <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="preprocessordirective">#define</span> ATOMIC_FLAG_INIT <i><span class="texttt">see below</span></i>

<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_thread_fence_"><a class="hidden_link" href="#lib:atomic_thread_fence" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_thread_fence</a></span>;                          <span class="comment">// <i><span class="texttt">see below</span></i></span>
<span class="keyword">using</span> std<span class="operator">::</span><span id="lib:atomic_signal_fence_"><a class="hidden_link" href="#lib:atomic_signal_fence" title="33.5.12 C compatibility [stdatomic.h.syn]">atomic_signal_fence</a></span>;                          <span class="comment">// <i><span class="texttt">see below</span></i></span>
</span></div><div class="para" id="stdatomic.h.syn-1"><div class="marginalizedparent"><a class="marginalized" href="#stdatomic.h.syn-1">1</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L6112">#</a></div><div class="texpara"><div id="stdatomic.h.syn-1.sentence-1" class="sentence">Each <a href="namespace.udecl#nt:using-declaration" title="9.9 The using declaration [namespace.udecl]"><span id="ntref:using-declaration"><span class="textsf"><i>using-declaration</i></span></span></a> for some name <span class="math"><span class="mathalpha">A</span></span> in the synopsis above
makes available the same entity as <span class="texttt">std<span class="operator">​::​</span><span class="math"><span class="mathalpha">A</span></span></span>
declared in <a href="#header:%3catomic%3e" title="33.5.2 Header <atomic> synopsis [atomics.syn]"><span id="headerref:<atomic>"><span class="texttt">&lt;atomic&gt;</span></span></a><a class="hidden_link" href="#stdatomic.h.syn-1.sentence-1">.</a></div> <div id="stdatomic.h.syn-1.sentence-2" class="sentence">Each macro listed above other than <span class="texttt">_<span class="shy"></span>Atomic<span class="parenthesis">(</span>T<span class="parenthesis">)</span></span>
is defined as in <a href="#header:%3catomic%3e" title="33.5.2 Header <atomic> synopsis [atomics.syn]"><span id="headerref:<atomic>_"><span class="texttt">&lt;atomic&gt;</span></span></a><a class="hidden_link" href="#stdatomic.h.syn-1.sentence-2">.</a></div> <div id="stdatomic.h.syn-1.sentence-3" class="sentence">It is unspecified whether <a href="#header:%3cstdatomic.h%3e" title="33.5.12 C compatibility [stdatomic.h.syn]"><span id="headerref:<stdatomic.h>"><span class="texttt">&lt;stdatomic.h&gt;</span></span></a> makes available
any declarations in namespace <span class="texttt">std</span><a class="hidden_link" href="#stdatomic.h.syn-1.sentence-3">.</a></div></div></div><div class="para" id="stdatomic.h.syn-2"><div class="marginalizedparent"><a class="marginalized" href="#stdatomic.h.syn-2">2</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L6121">#</a></div><div class="texpara"><div id="stdatomic.h.syn-2.sentence-1" class="sentence">Each of the <a href="namespace.udecl#nt:using-declaration" title="9.9 The using declaration [namespace.udecl]"><span id="ntref:using-declaration_"><span class="textsf"><i>using-declaration</i></span></span></a><i>s</i> for
<span class="texttt"><span class="keyword">int</span><span class="math"><span class="mathalpha">N</span></span>_<span class="shy"></span>t</span>, <span class="texttt">uint<span class="math"><span class="mathalpha">N</span></span>_<span class="shy"></span>t</span>, <span class="texttt">intptr_<span class="shy"></span>t</span>, and <span class="texttt">uintptr_<span class="shy"></span>t</span>
listed above is defined if and only if the implementation defines
the corresponding <a href="dcl.typedef#nt:typedef-name" title="9.2.4 The typedef specifier [dcl.typedef]"><span id="ntref:typedef-name"><span class="textsf"><i>typedef-name</i></span></span></a> in <a href="#syn" title="33.5.2 Header <atomic> synopsis">[atomics.<span class="shy"></span>syn]</a><a class="hidden_link" href="#stdatomic.h.syn-2.sentence-1">.</a></div></div></div><div class="para" id="stdatomic.h.syn-3"><div class="marginalizedparent"><a class="marginalized" href="#stdatomic.h.syn-3">3</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L6127">#</a></div><div class="texpara"><div id="stdatomic.h.syn-3.sentence-1" class="sentence">Neither the <span class="texttt">_<span class="shy"></span>Atomic</span> macro,
nor any of the non-macro global namespace declarations,
are provided by any C++ standard library header
other than <a href="#header:%3cstdatomic.h%3e" title="33.5.12 C compatibility [stdatomic.h.syn]"><span id="headerref:<stdatomic.h>_"><span class="texttt">&lt;stdatomic.h&gt;</span></span></a><a class="hidden_link" href="#stdatomic.h.syn-3.sentence-1">.</a></div></div></div><div class="para" id="stdatomic.h.syn-4"><div class="marginalizedparent"><a class="marginalized" href="#stdatomic.h.syn-4">4</a></div><div class="sourceLinkParent"><a class="sourceLink" href="http://github.com/Eelis/draft/tree/cce098de969bc8f89ababd4b8c0c5444a5c34f16/source/threads.tex#L6133">#</a></div><div class="texpara"><div id="stdatomic.h.syn-4.sentence-1" class="sentence"><i>Recommended practice</i>: Implementations should ensure
that C and C++ representations of atomic objects are compatible,
so that the same object can be accessed as both an <span class="texttt">_<span class="shy"></span>Atomic<span class="parenthesis">(</span>T<span class="parenthesis">)</span></span>
from C code and an <span class="texttt">atomic<span class="anglebracket">&lt;</span>T<span class="anglebracket">&gt;</span></span> from C++ code<a class="hidden_link" href="#stdatomic.h.syn-4.sentence-1">.</a></div> <div id="stdatomic.h.syn-4.sentence-2" class="sentence">The representations should be the same, and
the mechanisms used to ensure atomicity and memory ordering
should be compatible<a class="hidden_link" href="#stdatomic.h.syn-4.sentence-2">.</a></div></div></div></div>
</div>
<h3 id="feature-test-macro">Feature test macro</h3>

<div class="wording">
<h2><a href="http://eel.is/c++draft/version.syn">17.3.2 Header &lt;version&gt; synopsis [version.syn]</a></h2>
<span class="added"><code>#define __cpp_lib_constexpr_atomic 2024??L</code></span>
</div>

<h2 id="implementation-experience"><a href="#implementation-experience">Implementation experience</a></h2>
<p>This was implemented in libc++ &amp; clang by adding <code>constexpr</code> to needed places implementing atomic builtins.</p>

<h2 id="impact-on-existing-code"><a href="#impact-on-existing-code">Impact on existing code</a></h2>
None, currently <code>std::atomic</code> and <code>std::atomic_ref</code> can't be used in constant evaluated code.


</div></div></article>
</div><script>
	hljs.addPlugin(mergeHTMLPlugin);
	hljs.highlightAll();
</script>
</body>
</html>
