<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<html>
<style type="text/css">
  ins, ins * { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  del, del * { text-decoration:line-through; background-color:#FFA0A0 }
  #hidedel:checked ~ * del, #hidedel:checked ~ * del * { display:none; visibility:hidden }

blockquote {
  padding: .5em;
  border: .5em;
  border-color: silver;
  border-left-style: solid;
}

blockquote.std { color: #000000; background-color: #F1F1F1;
  border: 1px solid #D1D1D1;
  padding-left: 0.5em; padding-right: 0.5em; }
blockquote.stdins { text-decoration: underline;
  color: #000000; background-color: #C8FFC8;
  border: 1px solid #B3EBB3; padding: 0.5em; }
blockquote.stddel { text-decoration: line-through;
  color: #000000; background-color: #FFEBFF;
  border: 1px solid #ECD7EC;
  padding-left: 0.5em; padding-right: 0.5em; }

p.grammarlhs { margin-bottom: 0 }
p.grammarrhs { margin-left:8em; margin-top:0; margin-bottom:0; text-indent:-4em }

div.wrapper {
    max-width: 60em;
    margin: auto;
}

a { text-decoration: none; }

a.hidden_link {
    text-decoration: none;
    color: inherit;
}

li {
    margin-top: 0.0em;
    margin-bottom: 0.0em;
}

h1 { line-height: 1; }
h2 { line-height: 1; }
h3 { line-height: 1; }
h4 { line-height: 1; }

:target { background-color: #C9FBC9; }
:target .codeblock { background-color: #C9FBC9; }
:target ul { background-color: #C9FBC9; }

.abbr_ref { float: right; }

.folded_abbr_ref { float: right; }
:target .folded_abbr_ref { display: none; }

:target .unfolded_abbr_ref { float: right; display: inherit; }
.unfolded_abbr_ref { display: none; }

.secnum { display: inline-block; min-width: 35pt; }
.annexnum { display: block; }

div.sourceLinkParent {
    float: right;
}

a.sourceLink {
    position: absolute;
    opacity: 0;
    margin-left: 10pt;
}

a.sourceLink:hover {
    opacity: 1;
}

div.marginalizedparent {
    position: relative;
    left: -5em;
}

div.footnoteNumberParent {
    position: relative;
    left: -4.7em;
}

a.marginalized {
    position: absolute;
    font-size: 75%;
    text-align: right;
    width: 5em;
}

a.enumerated_item_num {
    position: relative;
    left: -3.5em;
    display: inline-block;
    margin-right: -3em;
    text-align: right;
    width: 3em;
}

div.para { margin-bottom: 0.6em; margin-top: 0.6em; text-align: justify; }
div.section { text-align: justify; }
div.sentence { display: inline; }

span.indexparent {
    display: inline;
    position: relative;
    float: right;
    right: -1em;
}

a.index {
    position: absolute;
    display: none;
}

a.index:before { content: "âŸµ"; }
    /* this way the content is not selectable */

a.index:target {
    display: inline;
}

.indexitems {
    margin-left: 2em;
    text-indent: -2em;
}

div.itemdescr {
    margin-left: 3em;
}

.bnf {
    font-family: serif;
    margin-left: 40pt;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.ncbnf {
    font-family: serif;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 40pt;
}

.bnftab {
    font-family: serif;
    font-style: italic;
    margin-left: 40pt;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.ncsimplebnf {
    font-family: serif;
    font-style: italic;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 40pt;
}

.ncbnftab {
    font-family: serif;
    font-style: italic;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 40pt;
}

.bnfkeywordtab {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    margin-left: 40pt;
}

span.textnormal {
    font-style: normal;
    font-family: serif;
    white-space: normal;
    display: inline-block;
}

span.descr { font-style: normal; font-family: serif; }
span.grammarterm { font-style: italic; }
span.term { font-style: italic; }
span.terminal { font-family: monospace; font-style: normal; }
span.nonterminal { font-style: italic; }
span.tcode { font-family: monospace; font-style: normal; }
span.textbf { font-weight: bold; }
span.textsc { font-variant: small-caps; }
a.nontermdef { font-style: italic; font-family: serif; }
span.emph { font-style: italic; }
span.techterm { font-style: italic; }
span.mathit { font-style: italic; }
span.mathsf { font-family: sans-serif; }
span.mathrm { font-family: serif; font-style: normal; }
span.textrm { font-family: serif; }
span.textsl { font-style: italic; }
span.mathtt { font-family: monospace; font-style: normal; }
span.mbox { font-family: serif; font-style: normal; }
span.ungap { display: inline-block; width: 2pt; }
span.textit { font-style: italic; }
span.texttt { font-family: monospace; }
span.tcode_in_codeblock { font-family: monospace; font-style: normal; }

span.phantom { color: white; }
span.math { }

span.mathblock {
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1.2em;
    margin-bottom: 1.2em;
    text-align: center;
}

span.mathalpha {
    font-style: italic;
}

span.synopsis {
    font-weight: bold;
    margin-top: 0.5em;
    display: block;
}

span.definition {
    font-weight: bold;
    display: block;
}

.codeblock {
    margin-left: 1.2em;
    line-height: 127%;
}

code {
    font-family: monospace;
    font-style: normal;
}

code.itemdecl {
    margin-top: 2ex;
    white-space: pre;
    display: block;
}

.comment {
    font-style: italic;
    font-family: serif;
}

span.textsuperscript {
    vertical-align: super;
    font-size: smaller;
    line-height: 0;
}

.footnotenum { vertical-align: super; font-size: smaller; line-height: 0; }

.footnote {
    font-size: small;
    margin-left: 2em;
    margin-right: 2em;
    margin-top: 0.6em;
    margin-bottom: 0.6em;
}

div.minipage {
    display: inline-block;
    margin-right: 3em;
}

div.numberedTable {
    text-align: center;
    margin: 2em;
}

div.figure {
    text-align: center;
    margin: 2em;
}

table {
    border: 1px solid black;
    border-collapse: collapse;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0.8em;
    text-align: left;
    hyphens: none; /* otherwise some columns get very narrow, e.g. [tab:hash] */
}

td, th {
    padding-left: 1em;
    padding-right: 1em;
    vertical-align: top;
}

td.left {
    text-align: left;
}

td.right {
    text-align: right;
}

td.center {
    text-align: center;
}

td.justify {
    text-align: justify;
}

td.border {
    border-left: 1px solid black;
}

tr.rowsep, td.cline {
    border-top: 1px solid black;
}

tr.capsep {
    border-top: 3px solid black;
    border-top-style: double;
}

th {
    border-bottom: 1px solid black;
}

span.centry {
    font-weight: bold;
}

div.table {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    width: 90%;
}

span.indented {
    display: block;
    margin-left: 2em;
    margin-bottom: 1em;
    margin-top: 1em;
}
</style>

<title>P1641R2: Freestanding Library: Rewording the Status Quo</title>
<body>
<h1>Freestanding Library: Rewording the Status Quo</h1>
Document number: P1641R2<br/>
Date: 2020-01-10<br/>
Reply-to: Ben Craig &lt;ben dot craig at gmail dot com&gt;<br/>
Audience: SG14, Library Evolution Working Group
<h1>Change history</h1>
<h3> R2 </h3>
<ul>
  <li>Rebased to N4842</li>
  <li>Accounting for addition / changes to version.syn</li>
  <li>Accounting for addition of <code>&lt;compare&gt;</code></li>
  <li>Added wording for freestanding-only macros</li>
</ul>
<h3> R1 </h3>
<ul>
  <li>Rebased to N4830</li>
  <li>Dealt with synchronization library additions</li>
  <li>Dealt with <code>source_location</code> addition</li>
  <li>Updated feature test macros</li>
  <li>Made new feature test macro name more consistent with other library names</li>
</ul>
<p>
</p>
<h3> R0 </h3>
<p>
Branching from P0829R4.  This "omnibus" paper is still the direction I am aiming for.  However, it is too difficult to review.  It needs to change with almost every meeting.  Therefore, it is getting split up into smaller, more manageable chunks.
</p><p>
Limiting paper to <code>&lt;version&gt;</code>, blanket wording, and freestanding facilities already in the working draft.
</p>
<h1>Introduction</h1>
<p>
This paper is the first of many smaller papers adding facilities to the C++ freestanding library.  This paper in particular will be updating the editorial technique for declaring facilities as freestanding and adjusting feature test macros.  This update will make it easier to mark headers as partially freestanding.  This wording change will make it easier to mark in-flight proposals as freestanding, without causing a major blocking point in the standardization process.
</p>
<h1>Motivation and Design</h1>
<p>
Many existing facilities in the C++ standard library could be used without trouble in freestanding environments.  This series of papers will specify the maximal subset of the C++ standard library that does not require an OS or space overhead.
</p><p>
For a more in depth rationale, see P0829.
</p><p>
This paper is going to add blanket wording to make it easier to mark things freestanding, and it will retrofit the existing freestanding facilities.  It also includes a non-normative note that should allow implementers to use existing no-exception builds of their libraries as an implementation defined extensions, with a fair number of qualifications.  Here's that note, reproduced so that it can be debated more effectively:
</p><p>
<div class='note'>[ <span class='textit'>Note</span><span class='textit'>:</span> Throwing a standard library provided exception is not observably different from <span class='texttt'>terminate()</span> if the implementation doesn't unwind the stack during exception handling and the user's program contains no catch blocks. -<i>end note</i>]</div>
</p><p>
The one intentional design change in this paper is in the feature test macros.  A new feature test macro will be added, and the existing library feature test macros will be annotated as required in freestanding or not.
</p>
<h1>Feature Test Macro</h1>
<p>
A freestanding implementation that provides support for this paper shall define the following feature test macro.
</p>
<table border="1">
    <thead><tr>
        <th>Name</th>
        <th>Value</th>
        <th>Header</th>
    </tr></thead>
    <tbody><tr>
        <td><code>__cpp_lib_freestanding</code></td>
        <td><var ignore="true">202001</var></td>
        <td><code>&lt;version&gt;<code></td>
    </tr></tbody>
</table>
<p>
Example usage:
</p>
<pre class='codeblock'>
#if __cpp_lib_freestanding &gt;= 202001
int my_atoi(const char *str);
#else
#include &lt;cstdlib&gt;
inline int my_atoi(const char *str) {return std::atoi(str);}
#endif
</pre>
<p>
The <code>__cpp_lib_freestanding</code> macro is useful for detecting the absence of throwing facilities.  A user could conditionally use a hand-rolled implementation in freestanding mode or the standard implementation in hosted mode.
</p><p>
The library feature macros have been partitioned into those that must be present in both freestanding and hosted mode, and those that only need to be present in hosted mode.  If the implementation provides more than the minimal freestanding subset, then the implementation shall also provide the corresponding feature test macros.
</p><p>
Example of a freestanding user detecting the presence of an optional feature:
</p>
<pre class='codeblock'>
#if __cpp_lib_addressof_constexpr &gt;= 201603
#include &lt;memory&gt;
template &lt;class T&gt;
constexpr std::decay_t&lt;T&gt;* my_addressof(T && arg) {
  return std::addressof(std::forward&lt;T&gt;(arg));
}
#else
template &lt;class T&gt;
constexpr std::decay_t&lt;T&gt;* my_addressof(T && arg) {
  return &amp;arg;
}
#endif
</pre>
</p>
<h1>Wording</h1>
<p>
The following changes are relative to N4842 from the Post-Belfast 2019 mailing.
</p>
Add a new subclause [freestanding.membership], under [conventions] and after [objects.within.classes]:
<blockquote class="stdins">
<h4 ><a class='secnum' style='min-width:118pt'>?.?.?.?</a> Freestanding membership <a class='abbr_ref'>[freestanding.membership]</a></h4>
<div class='para'>
    <div class='marginalizedparent'><a class='marginalized'>1</a></div>
    <div class='sentence'>Freestanding implementations have several declarations and macro definitions that shall meet the same requirements as for a hosted implementation unless otherwise specified.</div>
    <div class='note'>[ <span class='textit'>Note</span><span class='textit'>:</span> Throwing a standard library provided exception is not observably different from <span class='texttt'>terminate()</span> if the implementation doesn't unwind the stack during exception handling and the user's program contains no catch blocks. -<i>end note</i>]</div>
    <div class='sentence'>In the associated header synopsis for such declarations and macro definitions, the items shall be followed with a comment that ends with <span class='textit'>freestanding</span>, as in:</div>
<pre class='codeblock'>
#define E2BIG <span class='textit'><span class='texttt'>see below</span></span> <span class='comment'>// <span class='textit'>freestanding</span></span>
</pre>
</div>
<div class='para'>
    <div class='marginalizedparent'><a class='marginalized'>2</a></div>
    <div class='sentence'>Freestanding implementations have several headers that shall meet the same requirements as for a hosted implementation unless otherwise specified.</div>
    <div class='sentence'>The synopsis for these headers shall start with a comment that ends with <span class='textit'>freestanding</span>, as in:</div>
<pre class='codeblock'>
<span class='comment'>// <span class='textit'>freestanding</span></span>
namespace std {
</pre>
</div>
<div class='para'>
    <div class='marginalizedparent'><a class='marginalized'>3</a></div>
    <div class='sentence'>Freestanding implementations have some macro definitions that shall not be present on hosted implementations.</div>
    <div class='sentence'>In the associated header synopsis for such macro definitions, the items shall be followed with a comment that ends with <span class='textit'>freestanding only</span>, as in:</div>
<pre class='codeblock'>
#define __cpp_lib_freestanding 202001L <span class='comment'>// <span class='textit'>freestanding only</span></span>
</pre>
</div>
<div class='para'>
    <div class='marginalizedparent'><a class='marginalized'>4</a></div>
    <div class='sentence'>Deduction guides for <i>freestanding class templates</i> shall be implemented in freestanding implementations.</div>
    <div class='sentence'>Freestanding class templates are class templates that are implemented (partially or fully) in freestanding implementations.</div>
    <div class='marginalizedparent'><a class='marginalized'>5</a></div>
    <div class='sentence'>The containing namespace of each <i>freestanding declaration</i> shall be provided in a freestanding implementation.</div>
    <div class='sentence'>Freestanding declarations are non-namespace declarations that are implemented (partially or fully) in a freestanding implementation</div>
</div>
</blockquote>

Change in [compliance] paragraph 3:
<blockquote class="std">
<div class='para'>
<del>
    <div class='sentence'>The supplied version of the header
    <span class='texttt'><span class='anglebracket'>&lt;</span>cstdlib<span class='anglebracket'>&gt;</span></span>
    shall declare at least the functions
    <span class='texttt'>abort</span>,
    <span class='texttt'>atexit</span>,
    <span class='texttt'>at_&shy;quick_&shy;exit</span>,
    <span class='texttt'>exit</span>,
    and
    <span class='texttt'>quick_&shy;exit</span> ([support.start.term]).</div>

    <div class='sentence'>The supplied version of the header <span class='texttt'><span class='anglebracket'>&lt;</span>atomic<span class='anglebracket'>&gt;</span></span>
    shall meet the same requirements as for a hosted implementation
    except that support for
    always lock-free integral atomic types ([atomics.lockfree])
    is implementation-defined, and
    whether or not the type aliases <span class='texttt'>atomic_&shy;signed_&shy;lock_&shy;free</span> and
    <span class='texttt'>atomic_&shy;unsigned_&shy;lock_&shy;free</span> are defined ([atomics.alias])
    is implementation-defined.</div>
    <div class='sentence'>The other headers listed in this table
    shall meet the same requirements as for a hosted implementation.</div>
</del>

<ins>
    <div class='sentence'>The headers listed in this table shall meet the requirements for a freestanding implementation, as specified in the respective header synopsis.</div>
</ins>
</div>
</blockquote>

Instructions to the editor:<br/>
Please add a <span class='comment'>// <span class='textit'>freestanding</span></span> comment to the beginning of the following synopses.  These headers are entirely freestanding.
<ul>
<li><ins>[cstddef.syn]</ins></li>
<li><ins>[limits.syn]</ins></li>
<li><ins>[climits.syn]</ins></li>
<li><ins>[cfloat.syn]</ins></li>
<li><ins>[cstdint.syn]</ins></li>
<li><ins>[new.syn]</ins></li>
<li><ins>[typeinfo.syn]</ins></li>
<li><ins>[source_location.syn]</ins></li>
<li><ins>[exception.syn]</ins></li>
<li><ins>[initializer.list.syn]</ins></li>
<li><ins>[compare.syn]</ins></li>
<li><ins>[coroutine.syn]</ins></li>
<li><ins>[cstdarg.syn]</ins></li>
<li><ins>[concepts.syn]</ins></li>
<li><ins>[meta.type.synop]</ins></li>
<li><ins>[bit.syn]</ins></li>
</ul>

Change in [cstdlib.syn]:
<blockquote class="std">
<h3 ><a class='secnum' style='min-width:103pt'>???</a> Header <span class='texttt'>&lt;cstdlib&gt;</span> synopsis <a class='abbr_ref'>[cstdlib.syn]</a></h3>
<pre class='codeblock'>
namespace std {
  using size_t = <span class='textit'><span class='texttt'>see below</span></span>; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  using div_t = <span class='textit'><span class='texttt'>see below</span></span>;
  using ldiv_t = <span class='textit'><span class='texttt'>see below</span></span>;
  using lldiv_t = <span class='textit'><span class='texttt'>see below</span></span>;
}

#define NULL <span class='textit'><span class='texttt'>see below</span></span> <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
#define EXIT_FAILURE <span class='textit'><span class='texttt'>see below</span></span>
#define EXIT_SUCCESS <span class='textit'><span class='texttt'>see below</span></span>
#define RAND_MAX <span class='textit'><span class='texttt'>see below</span></span>
#define MB_CUR_MAX <span class='textit'><span class='texttt'>see below</span></span>

namespace std {
  <span class='comment'>// Exposition-only function type aliases
</span>  extern "C" using <span class='textit'>c-atexit-handler</span> = void();                        <span class='comment'>// <span class='textit'>exposition only</span>
</span>  extern "C++" using <span class='textit'>atexit-handler</span> = void();                        <span class='comment'>// <span class='textit'>exposition only</span>
</span>  extern "C" using <span class='textit'>c-compare-pred</span> = int(const void*, const void*);   <span class='comment'>// <span class='textit'>exposition only</span>
</span>  extern "C++" using <span class='textit'>compare-pred</span> = int(const void*, const void*);   <span class='comment'>// <span class='textit'>exposition only</span>
</span>
  <span class='comment'>// [support.start.term], start and termination
</span>  [[noreturn]] void abort() noexcept; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  int atexit(<span class='textit'>c-atexit-handler</span>* func) noexcept; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  int atexit(<span class='textit'>atexit-handler</span>* func) noexcept; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  int at_quick_exit(<span class='textit'>c-atexit-handler</span>* func) noexcept; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  int at_quick_exit(<span class='textit'>atexit-handler</span>* func) noexcept; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  [[noreturn]] void exit(int status); <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>
  [[noreturn]] void _Exit(int status) noexcept;
  [[noreturn]] void quick_exit(int status) noexcept; <ins><span class='comment'>// <span class='textit'>freestanding</span></span></ins>

  char* <span id='lib:getenv'><span class='tcode_in_codeblock'>getenv</span></span>(const char* name);
  int system(const char* string);

  <span class='comment'>// [c.malloc], C library memory allocation
</span>  void* aligned_alloc(size_t alignment, size_t size);
  void* calloc(size_t nmemb, size_t size);
  void free(void* ptr);
  void* malloc(size_t size);
  void* realloc(void* ptr, size_t size);

  double atof(const char* nptr);
  int atoi(const char* nptr);
  long int atol(const char* nptr);
  long long int atoll(const char* nptr);
  double strtod(const char* nptr, char** endptr);
  float strtof(const char* nptr, char** endptr);
  long double strtold(const char* nptr, char** endptr);
  long int strtol(const char* nptr, char** endptr, int base);
  long long int strtoll(const char* nptr, char** endptr, int base);
  unsigned long int strtoul(const char* nptr, char** endptr, int base);
  unsigned long long int strtoull(const char* nptr, char** endptr, int base);

  <span class='comment'>// [c.mb.wcs], multibyte / wide string and character conversion functions
</span>  int mblen(const char* s, size_t n);
  int mbtowc(wchar_t* pwc, const char* s, size_t n);
  int wctomb(char* s, wchar_t wchar);
  size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n);
  size_t wcstombs(char* s, const wchar_t* pwcs, size_t n);

  <span class='comment'>// [alg.c.library], C standard library algorithms
</span>  void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
                <span class='textit'>c-compare-pred</span>* compar);
  void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
                <span class='textit'>compare-pred</span>* compar);
  void qsort(void* base, size_t nmemb, size_t size, <span class='textit'>c-compare-pred</span>* compar);
  void qsort(void* base, size_t nmemb, size_t size, <span class='textit'>compare-pred</span>* compar);

  <span class='comment'>// [c.math.rand], low-quality random number generation
</span>  int rand();
  void srand(unsigned int seed);

  <span class='comment'>// [c.math.abs], absolute values
</span>  int abs(int j);
  long int abs(long int j);
  long long int abs(long long int j);
  float abs(float j);
  double abs(double j);
  long double abs(long double j);

  long int labs(long int j);
  long long int llabs(long long int j);

  div_t div(int numer, int denom);
  ldiv_t div(long int numer, long int denom);             <span class='comment'>// see [library.c]
</span>  lldiv_t div(long long int numer, long long int denom);  <span class='comment'>// see [library.c]
</span>  ldiv_t ldiv(long int numer, long int denom);
  lldiv_t lldiv(long long int numer, long long int denom);
}</pre>
</blockquote>

Change in [version.syn]:<br/>
Instructions to the editor:<br/>

Please add the following macro definition to [version.syn]
<blockquote class="stdins"><pre class='codeblock'>
#define __cpp_lib_freestanding 202001L <span class='comment'>// <span class='textit'>freestanding only</span></span>
</pre></blockquote>

Please add a <span class='comment'>// <span class='textit'>freestanding</span></span> comment to the following macro definitions:
<ul>
<li><ins><code>__cpp_lib_atomic_flag_test</code></ins></li>
<li><ins><code>__cpp_lib_atomic_float</code></ins></li>
<li><ins><code>__cpp_lib_atomic_is_always_lock_free</code></ins></li>
<li><ins><code>__cpp_lib_atomic_ref</code></ins></li>
<li><ins><code>__cpp_lib_atomic_value_initialization</code></ins></li>
<li><ins><code>__cpp_lib_atomic_wait</code></ins></li>
<li><ins><code>__cpp_lib_bit_cast</code></ins></li>
<li><ins><code>__cpp_lib_bitops</code></ins></li>
<li><ins><code>__cpp_lib_bool_constant</code></ins></li>
<li><ins><code>__cpp_lib_bounded_array_traits</code></ins></li>
<li><ins><code>__cpp_lib_byte</code></ins></li>
<li><ins><code>__cpp_lib_char8_t</code></ins></li>
<li><ins><code>__cpp_lib_concepts</code></ins></li>
<li><ins><code>__cpp_lib_destroying_delete</code></ins></li>
<li><ins><code>__cpp_lib_endian</code></ins></li>
<li><ins><code>__cpp_lib_hardware_interference_size</code></ins></li>
<li><ins><code>__cpp_lib_has_unique_object_representations</code></ins></li>
<li><ins><code>__cpp_lib_int_pow2</code></ins></li>
<li><ins><code>__cpp_lib_integral_constant_callable</code></ins></li>
<li><ins><code>__cpp_lib_is_aggregate</code></ins></li>
<li><ins><code>__cpp_lib_is_constant_evaluated</code></ins></li>
<li><ins><code>__cpp_lib_is_final</code></ins></li>
<li><ins><code>__cpp_lib_is_invocable</code></ins></li>
<li><ins><code>__cpp_lib_is_layout_compatible</code></ins></li>
<li><ins><code>__cpp_lib_is_null_pointer</code></ins></li>
<li><ins><code>__cpp_lib_is_pointer_interconvertible</code></ins></li>
<li><ins><code>__cpp_lib_is_swappable</code></ins></li>
<li><ins><code>__cpp_lib_launder</code></ins></li>
<li><ins><code>__cpp_lib_logical_traits</code></ins></li>
<li><ins><code>__cpp_lib_nothrow_convertible</code></ins></li>
<li><ins><code>__cpp_lib_remove_cvref</code></ins></li>
<li><ins><code>__cpp_lib_result_of_sfinae</code></ins></li>
<li><ins><code>__cpp_lib_source_location</code></ins></li>
<li><ins><code>__cpp_lib_three_way_comparison</code></ins></li>
<li><ins><code>__cpp_lib_transformation_trait_aliases</code></ins></li>
<li><ins><code>__cpp_lib_type_identity</code></ins></li>
<li><ins><code>__cpp_lib_type_trait_variable_templates</code></ins></li>
<li><ins><code>__cpp_lib_uncaught_exceptions</code></ins></li>
<li><ins><code>__cpp_lib_void_t</code></ins></li>
</ul>

Instructions to the editor:
<p>
Please add a <span class='comment'>// <span class='textit'>freestanding</span></span> comment to all entities in [atomics.syn] other than <code>atomic_signed_lock_free</code> and <code>atomic_unsigned_lock_free</code>
</p>

Change in [atomics.lockfree] paragraph 2:
<blockquote class="std">
<div class='para'>
<div class='sentence'><ins>On hosted implementations ([compliance]), a</ins><del>A</del>t least one signed integral specialization of the <span class='texttt'>atomic</span> template,
along with the specialization
for the corresponding unsigned type ([basic.fundamental]),
is always lock-free.</div>
<del><div class='note'>[&nbsp;<span class='textit'>Note</span><div class='noteBody'><span class='textit'>:</span> <div class='sentence'>This requirement is optional in freestanding implementations ([compliance]).</div> —&nbsp;<i>end note</i></div>&nbsp;]</div></del> </div>
</blockquote>

<h1>Acknowledgements</h1>
<p>
Thanks to Brandon Streiff, Joshua Cannon, Phil Hindman, and Irwan Djajadi for reviewing P0829.
</p><p>
Thanks to Odin Holmes for providing feedback and helping publicize P0829.
</p><p>
Thanks to Paul Bendixen for providing feedback while prototyping P0829.
</p><p>
Similar work was done in the C++11 timeframe by Lawrence Crowl and Alberto Ganesh Barbati in <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3256.html">N3256</a>.
</p>
</body>
</html>
