<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang xml:lang>
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="mpark/wg21" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
  <meta name="dcterms.date" content="2021-01-12" />
  <title>constexpr for specialized memory algorithms</title>
  <style>
      code{white-space: pre-wrap;}
      span.smallcaps{font-variant: small-caps;}
      span.underline{text-decoration: underline;}
      div.column{display: inline-block; vertical-align: top; width: 50%;}
      div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
      ul.task-list{list-style: none;}
      pre > code.sourceCode { white-space: pre; position: relative; }
      pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
      pre > code.sourceCode > span:empty { height: 1.2em; }
      code.sourceCode > span { color: inherit; text-decoration: inherit; }
      div.sourceCode { margin: 1em 0; }
      pre.sourceCode { margin: 0; }
      @media screen {
      div.sourceCode { overflow: auto; }
      }
      @media print {
      pre > code.sourceCode { white-space: pre-wrap; }
      pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
      }
      pre.numberSource code
        { counter-reset: source-line 0; }
      pre.numberSource code > span
        { position: relative; left: -4em; counter-increment: source-line; }
      pre.numberSource code > span > a:first-child::before
        { content: counter(source-line);
          position: relative; left: -1em; text-align: right; vertical-align: baseline;
          border: none; display: inline-block;
          -webkit-touch-callout: none; -webkit-user-select: none;
          -khtml-user-select: none; -moz-user-select: none;
          -ms-user-select: none; user-select: none;
          padding: 0 4px; width: 4em;
          color: #aaaaaa;
        }
      pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa;  padding-left: 4px; }
      div.sourceCode
        {  background-color: #f6f8fa; }
      @media screen {
      pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
      }
      code span. { } /* Normal */
      code span.al { color: #ff0000; } /* Alert */
      code span.an { } /* Annotation */
      code span.at { } /* Attribute */
      code span.bn { color: #9f6807; } /* BaseN */
      code span.bu { color: #9f6807; } /* BuiltIn */
      code span.cf { color: #00607c; } /* ControlFlow */
      code span.ch { color: #9f6807; } /* Char */
      code span.cn { } /* Constant */
      code span.co { color: #008000; font-style: italic; } /* Comment */
      code span.cv { color: #008000; font-style: italic; } /* CommentVar */
      code span.do { color: #008000; } /* Documentation */
      code span.dt { color: #00607c; } /* DataType */
      code span.dv { color: #9f6807; } /* DecVal */
      code span.er { color: #ff0000; font-weight: bold; } /* Error */
      code span.ex { } /* Extension */
      code span.fl { color: #9f6807; } /* Float */
      code span.fu { } /* Function */
      code span.im { } /* Import */
      code span.in { color: #008000; } /* Information */
      code span.kw { color: #00607c; } /* Keyword */
      code span.op { color: #af1915; } /* Operator */
      code span.ot { } /* Other */
      code span.pp { color: #6f4e37; } /* Preprocessor */
      code span.re { } /* RegionMarker */
      code span.sc { color: #9f6807; } /* SpecialChar */
      code span.ss { color: #9f6807; } /* SpecialString */
      code span.st { color: #9f6807; } /* String */
      code span.va { } /* Variable */
      code span.vs { color: #9f6807; } /* VerbatimString */
      code span.wa { color: #008000; font-weight: bold; } /* Warning */
      code.diff {color: #898887}
      code.diff span.va {color: #006e28}
      code.diff span.st {color: #bf0303}
  </style>
  <style type="text/css">
body {
margin: 5em;
font-family: serif;

hyphens: auto;
line-height: 1.35;
}
div.wrapper {
max-width: 60em;
margin: auto;
}
ul {
list-style-type: none;
padding-left: 2em;
margin-top: -0.2em;
margin-bottom: -0.2em;
}
a {
text-decoration: none;
color: #4183C4;
}
a.hidden_link {
text-decoration: none;
color: inherit;
}
li {
margin-top: 0.6em;
margin-bottom: 0.6em;
}
h1, h2, h3, h4 {
position: relative;
line-height: 1;
}
a.self-link {
position: absolute;
top: 0;
left: calc(-1 * (3.5rem - 26px));
width: calc(3.5rem - 26px);
height: 2em;
text-align: center;
border: none;
transition: opacity .2s;
opacity: .5;
font-family: sans-serif;
font-weight: normal;
font-size: 83%;
}
a.self-link:hover { opacity: 1; }
a.self-link::before { content: "§"; }
ul > li:before {
content: "\2014";
position: absolute;
margin-left: -1.5em;
}
: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; }
.header-section-number { 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;
}
a.itemDeclLink {
position: absolute;
font-size: 75%;
text-align: right;
width: 5em;
opacity: 0;
}
a.itemDeclLink:hover { opacity: 1; }
span.marginalizedparent {
position: relative;
left: -5em;
}
li span.marginalizedparent { left: -7em; }
li ul > li span.marginalizedparent { left: -9em; }
li ul > li ul > li span.marginalizedparent { left: -11em; }
li ul > li ul > li ul > li span.marginalizedparent { left: -13em; }
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: "⟵"; }

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;
}
.ncsimplebnf {
font-family: serif;
font-style: italic;
margin-top: 0.5em;
margin-bottom: 0.5em;
margin-left: 40pt;
background: inherit; 
}
span.textnormal {
font-style: normal;
font-family: serif;
white-space: normal;
display: inline-block;
}
span.rlap {
display: inline-block;
width: 0px;
}
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 { font-style: normal; }
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%;
}
.outputblock {
margin-left: 1.2em;
line-height: 127%;
}
div.itemdecl {
margin-top: 2ex;
}
code.itemdeclcode {
white-space: pre;
display: block;
}
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; 
}
td, th {
padding-left: 1em;
padding-right: 1em;
vertical-align: top;
}
td.empty {
padding: 0px;
padding-left: 1px;
}
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.even, tr.odd {
border-bottom: 1px solid black;
}
tr.capsep {
border-top: 3px solid black;
border-top-style: double;
}
tr.header {
border-bottom: 3px solid black;
border-bottom-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;
}
ol.enumeratea { list-style-type: none; background: inherit; }
ol.enumerate { list-style-type: none; background: inherit; }

code.sourceCode > span { display: inline; }
</style>
  <link href="data:image/x-icon;base64,AAABAAIAEBAAAAEAIABoBAAAJgAAACAgAAABACAAqBAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AIJEAACCRAAAgkQAAIJEAACCRAAAgkQAVoJEAN6CRADegkQAWIJEAACCRAAAgkQAAIJEAACCRAAA////AP///wCCRAAAgkQAAIJEAACCRAAsgkQAvoJEAP+CRAD/gkQA/4JEAP+CRADAgkQALoJEAACCRAAAgkQAAP///wD///8AgkQAAIJEABSCRACSgkQA/IJEAP99PQD/dzMA/3czAP99PQD/gkQA/4JEAPyCRACUgkQAFIJEAAD///8A////AHw+AFiBQwDqgkQA/4BBAP9/PxP/uZd6/9rJtf/bybX/upd7/39AFP+AQQD/gkQA/4FDAOqAQgBc////AP///wDKklv4jlEa/3o7AP+PWC//8+3o///////////////////////z7un/kFox/35AAP+GRwD/mVYA+v///wD///8A0Zpk+NmibP+0d0T/8evj///////+/fv/1sKz/9bCs//9/fr//////+/m2/+NRwL/nloA/5xYAPj///8A////ANKaZPjRmGH/5cKh////////////k149/3UwAP91MQD/lmQ//86rhv+USg3/m1YA/5hSAP+bVgD4////AP///wDSmmT4zpJY/+/bx///////8+TV/8mLT/+TVx//gkIA/5lVAP+VTAD/x6B//7aEVv/JpH7/s39J+P///wD///8A0ppk+M6SWP/u2sf///////Pj1f/Nj1T/2KFs/8mOUv+eWhD/lEsA/8aee/+0glT/x6F7/7J8Rvj///8A////ANKaZPjRmGH/48Cf///////+/v7/2qt//82PVP/OkFX/37KJ/86siv+USg7/mVQA/5hRAP+bVgD4////AP///wDSmmT40ppk/9CVXP/69O////////7+/v/x4M//8d/P//7+/f//////9u7n/6tnJf+XUgD/nFgA+P///wD///8A0ppk+NKaZP/RmWL/1qNy//r07///////////////////////+vXw/9akdP/Wnmn/y5FY/6JfFvj///8A////ANKaZFTSmmTo0ppk/9GYYv/Ql1//5cWm//Hg0P/x4ND/5cWm/9GXYP/RmGH/0ppk/9KaZOjVnmpY////AP///wDSmmQA0ppkEtKaZI7SmmT60ppk/9CWX//OkVb/zpFW/9CWX//SmmT/0ppk/NKaZJDSmmQS0ppkAP///wD///8A0ppkANKaZADSmmQA0ppkKtKaZLrSmmT/0ppk/9KaZP/SmmT/0ppkvNKaZCrSmmQA0ppkANKaZAD///8A////ANKaZADSmmQA0ppkANKaZADSmmQA0ppkUtKaZNzSmmTc0ppkVNKaZADSmmQA0ppkANKaZADSmmQA////AP5/AAD4HwAA4AcAAMADAACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAMADAADgBwAA+B8AAP5/AAAoAAAAIAAAAEAAAAABACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA////AP///wCCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAAyCRACMgkQA6oJEAOqCRACQgkQAEIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAA////AP///wD///8A////AIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRABigkQA5oJEAP+CRAD/gkQA/4JEAP+CRADqgkQAZoJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAAD///8A////AP///wD///8AgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAA4gkQAwoJEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAP+CRAD/gkQAxIJEADyCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAAgkQAAP///wD///8A////AP///wCCRAAAgkQAAIJEAACCRAAAgkQAAIJEAACCRAAWgkQAmIJEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAJyCRAAYgkQAAIJEAACCRAAAgkQAAIJEAACCRAAA////AP///wD///8A////AIJEAACCRAAAgkQAAIJEAACCRAAAgkQAdIJEAPCCRAD/gkQA/4JEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAP+CRAD/gkQA/4JEAPSCRAB4gkQAAIJEAACCRAAAgkQAAIJEAAD///8A////AP///wD///8AgkQAAIJEAACCRAAAgkQASoJEANKCRAD/gkQA/4JEAP+CRAD/g0YA/39AAP9zLgD/bSQA/2shAP9rIQD/bSQA/3MuAP9/PwD/g0YA/4JEAP+CRAD/gkQA/4JEAP+CRADUgkQAToJEAACCRAAAgkQAAP///wD///8A////AP///wB+PwAAgkUAIoJEAKiCRAD/gkQA/4JEAP+CRAD/hEcA/4BBAP9sIwD/dTAA/5RfKv+viF7/vp56/76ee/+wiF7/lWAr/3YxAP9sIwD/f0AA/4RHAP+CRAD/gkQA/4JEAP+CRAD/gkQArIJEACaBQwAA////AP///wD///8A////AIBCAEBzNAD6f0EA/4NFAP+CRAD/gkQA/4VIAP92MwD/bSUA/6N1Tv/ezsL/////////////////////////////////38/D/6V3Uv9uJgD/dTEA/4VJAP+CRAD/gkQA/4JEAP+BQwD/fUAA/4FDAEj///8A////AP///wD///8AzJRd5qBlKf91NgD/dDUA/4JEAP+FSQD/cy4A/3YyAP/PuKP//////////////////////////////////////////////////////9K7qP94NQD/ciwA/4VJAP+CRAD/fkEA/35BAP+LSwD/mlYA6v///wD///8A////AP///wDdpnL/4qx3/8KJUv+PUhf/cTMA/3AsAP90LgD/4dK+/////////////////////////////////////////////////////////////////+TYxf91MAD/dTIA/31CAP+GRwD/llQA/6FcAP+gWwD8////AP///wD///8A////ANGZY/LSm2X/4ap3/92mcP+wdT3/byQA/8mwj////////////////////////////////////////////////////////////////////////////+LYxv9zLgP/jUoA/59bAP+hXAD/nFgA/5xYAPL///8A////AP///wD///8A0ppk8tKaZP/RmWL/1p9q/9ubXv/XqXj////////////////////////////7+fD/vZyG/6BxS/+gcUr/vJuE//r37f//////////////////////3MOr/5dQBf+dVQD/nVkA/5xYAP+cWAD/nFgA8v///wD///8A////AP///wDSmmTy0ppk/9KaZP/SmWP/yohJ//jo2P//////////////////////4NTG/4JDFf9lGAD/bSQA/20kAP9kGAD/fz8S/+Xb0f//////5NG9/6txN/+LOgD/m1QA/51aAP+cWAD/m1cA/5xYAP+cWADy////AP///wD///8A////ANKaZPLSmmT/0ppk/8+TWf/Unmv//v37//////////////////////+TWRr/VwsA/35AAP+ERgD/g0UA/4JGAP9lHgD/kFga/8KXX/+TRwD/jT4A/49CAP+VTQD/n10A/5xYAP+OQQD/lk4A/55cAPL///8A////AP///wD///8A0ppk8tKaZP/SmmT/y4tO/92yiP//////////////////////8NnE/8eCQP+rcTT/ez0A/3IyAP98PgD/gEMA/5FSAP+USwD/jj8A/5lUAP+JNwD/yqV2/694Mf+HNQD/jkAA/82rf/+laBj/jT4A8v///wD///8A////AP///wDSmmTy0ppk/9KaZP/LiUr/4byY///////////////////////gupX/0I5P/+Wuev/Lklz/l1sj/308AP+QSwD/ol0A/59aAP+aVQD/k0oA/8yoh///////+fXv/6pwO//Lp3v///////Pr4f+oay7y////AP///wD///8A////ANKaZPLSmmT/0ppk/8uJSv/hvJj//////////////////////+G7l//Jhkb/0ppk/96nc//fqXX/x4xO/6dkFP+QSQD/llEA/5xXAP+USgD/yaOA///////38uv/qG05/8ijdv//////8efb/6ZpLPL///8A////AP///wD///8A0ppk8tKaZP/SmmT/zIxO/9yxh///////////////////////7dbA/8iEQf/Sm2X/0Zlj/9ScZv/eqHf/2KJv/7yAQf+XTgD/iToA/5lSAP+JNgD/yKFv/611LP+HNQD/jT8A/8qmeP+kZRT/jT4A8v///wD///8A////AP///wDSmmTy0ppk/9KaZP/Pk1n/1J5q//78+//////////////////+/fv/1aFv/8iEQv/Tm2b/0ppl/9GZY//Wn2z/1pZc/9eldf/Bl2b/kUcA/4w9AP+OQAD/lUwA/59eAP+cWQD/jT8A/5ZOAP+eXADy////AP///wD///8A////ANKaZPLSmmT/0ppk/9KZY//KiEn/8d/P///////////////////////47+f/05tm/8iCP//KiEj/yohJ/8eCP//RmGH//vfy///////n1sP/rXQ7/4k4AP+TTAD/nVoA/5xYAP+cVwD/nFgA/5xYAPL///8A////AP///wD///8A0ppk8tKaZP/SmmT/0ptl/8uLTf/aq37////////////////////////////+/fz/6c2y/961jv/etY7/6Myx//78+v//////////////////////3MWv/5xXD/+ORAD/mFQA/51ZAP+cWAD/nFgA8v///wD///8A////AP///wDSmmTy0ppk/9KaZP/SmmT/0ppk/8mFRP/s1b//////////////////////////////////////////////////////////////////////////////+PD/0JFU/7NzMv+WUQD/kUsA/5tXAP+dWQDy////AP///wD///8A////ANKaZP/SmmT/0ppk/9KaZP/Sm2X/z5NZ/8yMT//z5NX/////////////////////////////////////////////////////////////////9Ofa/8yNUP/UmGH/36p5/8yTWv+qaSD/kksA/5ROAPz///8A////AP///wD///8A0ppk5NKaZP/SmmT/0ppk/9KaZP/TnGf/zY9T/82OUv/t1sD//////////////////////////////////////////////////////+7Yw//OkFX/zI5R/9OcZ//SmmP/26V0/9ymdf/BhUf/ol8R6P///wD///8A////AP///wDSmmQ80ppk9tKaZP/SmmT/0ppk/9KaZP/TnGj/zpFW/8qJSv/dson/8uHS//////////////////////////////////Lj0//etIv/y4lL/86QVf/TnGj/0ppk/9KaZP/RmWP/05xn/9ymdfjUnWdC////AP///wD///8A////ANKaZADSmmQc0ppkotKaZP/SmmT/0ppk/9KaZP/Tm2b/0Zli/8qJSf/NjlH/16Z3/+G8mP/myKr/5siq/+G8mP/Xp3f/zY5S/8qISf/RmGH/05tm/9KaZP/SmmT/0ppk/9KaZP/SmmSm0pljINWdaQD///8A////AP///wD///8A0ppkANKaZADSmmQA0ppkQtKaZMrSmmT/0ppk/9KaZP/SmmT/0ptl/9GYYf/Nj1P/y4lL/8qISP/KiEj/y4lK/82PU//RmGH/0ptl/9KaZP/SmmT/0ppk/9KaZP/SmmTO0ppkRtKaZADSmmQA0ppkAP///wD///8A////AP///wDSmmQA0ppkANKaZADSmmQA0ppkANKaZGzSmmTu0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmTw0ppkcNKaZADSmmQA0ppkANKaZADSmmQA////AP///wD///8A////ANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZBLSmmSQ0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppklNKaZBTSmmQA0ppkANKaZADSmmQA0ppkANKaZAD///8A////AP///wD///8A0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQy0ppkutKaZP/SmmT/0ppk/9KaZP/SmmT/0ppk/9KaZP/SmmT/0ppkvtKaZDbSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkAP///wD///8A////AP///wDSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkXNKaZODSmmT/0ppk/9KaZP/SmmT/0ppk5NKaZGDSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA////AP///wD///8A////ANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkBtKaZIbSmmTo0ppk6tKaZIrSmmQK0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZADSmmQA0ppkANKaZAD///8A////AP/8P///+B///+AH//+AAf//AAD//AAAP/AAAA/gAAAHwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA+AAAAfwAAAP/AAAP/8AAP//gAH//+AH///4H////D//" rel="icon" />
  <!--[if lt IE 9]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
  <![endif]-->
  
</head>
<body>
<div class="wrapper">
<header id="title-block-header">
<h1 class="title" style="text-align:center">constexpr for specialized memory algorithms</h1>

<table style="border:none;float:right">
  <tr>
    <td>Document #:</td>
    <td>P2283R0</td>
  </tr>
  <tr>
    <td>Date:</td>
    <td>2021-01-12</td>
  </tr>
  <tr>
    <td style="vertical-align:top">Project:</td>
    <td>Programming Language C++</td>
  </tr>
  <tr>
    <td style="vertical-align:top">Audience:</td>
    <td>
      Library Evolution Group<br>
    </td>
  </tr>
  <tr>
    <td style="vertical-align:top">Reply-to:</td>
    <td>
      Michael Schellenberger Costa<br>&lt;<a href="mailto:mschellenbergercosta@googlemail.com" class="email">mschellenbergercosta@googlemail.com</a>&gt;<br>
    </td>
  </tr>
</table>

</header>
<div style="clear:both">
<h1 data-number="1" id="introduction"><span class="header-section-number">1</span> Introduction<a href="#introduction" class="self-link"></a></h1>
<p>This paper proposes adding <code class="sourceCode default">constexpr</code> support to the specialized memory algorithms. This is essentially a followup to <span class="citation" data-cites="P0784R7">[<a href="#ref-P0784R7" role="doc-biblioref">P0784R7</a>]</span> which added <code class="sourceCode default">constexpr</code> support for all necessary machinery.</p>
<h1 data-number="2" id="motivation-and-scope"><span class="header-section-number">2</span> Motivation and Scope<a href="#motivation-and-scope" class="self-link"></a></h1>
<p>These algorithms have been forgotten in the final crunch to get C++20 out. To add insult to injury, they are essential to implementing <code class="sourceCode default">constexpr</code> container support, so every library has to provide its own internal helpers to do the exact same thing during constant evaluation. Just fill the void and add <code class="sourceCode default">constexpr</code> everywhere except the parallel overloads.</p>
<p>But wait, what about <code class="sourceCode default">uninitialized_default_construct</code>? We cannot use <code class="sourceCode default">std::construct_at</code> there! This is correct and there are two possible solutions:</p>
<ol type="1">
<li><p>Add an overload of <code class="sourceCode default">std::construct_at</code> that takes a <code class="sourceCode default">std::default_construct_tag</code> and does the right thing. This is just bad design. If we go to the trouble of inventing a new name, we should do #2</p></li>
<li><p>Add a new library function <code class="sourceCode default">std::default_construct_at</code> that does the right thing. This is what is proposed here.</p></li>
</ol>
<h1 data-number="3" id="impact-on-the-standard"><span class="header-section-number">3</span> Impact on the Standard<a href="#impact-on-the-standard" class="self-link"></a></h1>
<p>This proposal is a pure library extension.</p>
<h1 data-number="4" id="proposed-wording"><span class="header-section-number">4</span> Proposed Wording<a href="#proposed-wording" class="self-link"></a></h1>
<h2 data-number="4.1" id="modify-7.7-expr.const-6-of-n4762-as-follows"><span class="header-section-number">4.1</span> Modify <strong>7.7 [expr.const] §6</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-7.7-expr.const-6-of-n4762-as-follows" class="self-link"></a></h2>
<p>For the purposes of determining whether an expression E is a core constant expression, the evaluation of a call to a member function of std::allocator<T> as defined in [allocator.members], where T is a literal type, does not disqualify E from being a core constant expression, even if the actual evaluation of such a call would otherwise fail the requirements for a core constant expression. Similarly, the evaluation of a call to std::destroy_­at, std::ranges::destroy_­at, <span class="add" style="color: #006e28"><ins>std::default_construct_at, std::ranges::default_construct_at,</ins></span> std::construct_­at, or std::ranges::construct_­at does not disqualify E from being a core constant expression unless:</p>
<p>for a call to <span class="add" style="color: #006e28"><ins>std::default_construct_at, std::ranges::default_construct_at,</ins></span> std::construct_­at or std::ranges::construct_­at, the first argument, of type T*, does not point to storage allocated with std::allocator<T> or to an object whose lifetime began within the evaluation of E, or the evaluation of the underlying constructor call disqualifies E from being a core constant expression, or</p>
<h2 data-number="4.2" id="modify-20.10.2-memory.syn-of-n4762-as-follows"><span class="header-section-number">4.2</span> Modify <strong>20.10.2 [memory.syn]</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-20.10.2-memory.syn-of-n4762-as-follows" class="self-link"></a></h2>
<div class="sourceCode" id="cb1"><pre class="sourceCode default"><code class="sourceCode default"><span id="cb1-1"><a href="#cb1-1"></a>  template&lt;class NoThrowForwardIterator&gt;</span>
<span id="cb1-2"><a href="#cb1-2"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> void uninitialized_default_construct(NoThrowForwardIterator first,</span>
<span id="cb1-3"><a href="#cb1-3"></a>                                                   NoThrowForwardIterator last);</span>
<span id="cb1-4"><a href="#cb1-4"></a></span>
<span id="cb1-5"><a href="#cb1-5"></a>  template&lt;class ExecutionPolicy, class NoThrowForwardIterator&gt;</span>
<span id="cb1-6"><a href="#cb1-6"></a>    void uninitialized_default_construct(ExecutionPolicy&amp;&amp; exec,        // see [algorithms.parallel.overloads]</span>
<span id="cb1-7"><a href="#cb1-7"></a>                                         NoThrowForwardIterator first,</span>
<span id="cb1-8"><a href="#cb1-8"></a>                                         NoThrowForwardIterator last);</span>
<span id="cb1-9"><a href="#cb1-9"></a>  template&lt;class NoThrowForwardIterator, class Size&gt;</span>
<span id="cb1-10"><a href="#cb1-10"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> NoThrowForwardIterator</span>
<span id="cb1-11"><a href="#cb1-11"></a>      uninitialized_default_construct_n(NoThrowForwardIterator first, Size n);</span>
<span id="cb1-12"><a href="#cb1-12"></a>  template&lt;class ExecutionPolicy, class NoThrowForwardIterator, class Size&gt;</span>
<span id="cb1-13"><a href="#cb1-13"></a>    NoThrowForwardIterator</span>
<span id="cb1-14"><a href="#cb1-14"></a>      uninitialized_default_construct_n(ExecutionPolicy&amp;&amp; exec,         // see [algorithms.parallel.overloads]</span>
<span id="cb1-15"><a href="#cb1-15"></a>                                        NoThrowForwardIterator first, Size n);</span>
<span id="cb1-16"><a href="#cb1-16"></a></span>
<span id="cb1-17"><a href="#cb1-17"></a>  namespace ranges {</span>
<span id="cb1-18"><a href="#cb1-18"></a>    template&lt;no-throw-forward-iterator I, no-throw-sentinel-for&lt;I&gt; S&gt;</span>
<span id="cb1-19"><a href="#cb1-19"></a>      requires default_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb1-20"><a href="#cb1-20"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> I uninitialized_default_construct(I first, S last);</span>
<span id="cb1-21"><a href="#cb1-21"></a>    template&lt;no-throw-forward-range R&gt;</span>
<span id="cb1-22"><a href="#cb1-22"></a>      requires default_initializable&lt;range_value_t&lt;R&gt;&gt;</span>
<span id="cb1-23"><a href="#cb1-23"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> borrowed_iterator_t&lt;R&gt; uninitialized_default_construct(R&amp;&amp; r);</span>
<span id="cb1-24"><a href="#cb1-24"></a></span>
<span id="cb1-25"><a href="#cb1-25"></a>    template&lt;no-throw-forward-iterator I&gt;</span>
<span id="cb1-26"><a href="#cb1-26"></a>      requires default_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb1-27"><a href="#cb1-27"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> I uninitialized_default_construct_n(I first, iter_difference_t&lt;I&gt; n);</span>
<span id="cb1-28"><a href="#cb1-28"></a>  }</span>
<span id="cb1-29"><a href="#cb1-29"></a></span>
<span id="cb1-30"><a href="#cb1-30"></a>  template&lt;class NoThrowForwardIterator&gt;</span>
<span id="cb1-31"><a href="#cb1-31"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> void uninitialized_value_construct(NoThrowForwardIterator first,</span>
<span id="cb1-32"><a href="#cb1-32"></a>                                                   NoThrowForwardIterator last);</span>
<span id="cb1-33"><a href="#cb1-33"></a>  template&lt;class ExecutionPolicy, class NoThrowForwardIterator&gt;</span>
<span id="cb1-34"><a href="#cb1-34"></a>    void uninitialized_value_construct(ExecutionPolicy&amp;&amp; exec,  // see [algorithms.parallel.overloads]</span>
<span id="cb1-35"><a href="#cb1-35"></a>                                       NoThrowForwardIterator first,</span>
<span id="cb1-36"><a href="#cb1-36"></a>                                       NoThrowForwardIterator last);</span>
<span id="cb1-37"><a href="#cb1-37"></a>  template&lt;class NoThrowForwardIterator, class Size&gt;</span>
<span id="cb1-38"><a href="#cb1-38"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> NoThrowForwardIterator</span>
<span id="cb1-39"><a href="#cb1-39"></a>      uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);</span>
<span id="cb1-40"><a href="#cb1-40"></a>  template&lt;class ExecutionPolicy, class NoThrowForwardIterator, class Size&gt;</span>
<span id="cb1-41"><a href="#cb1-41"></a>    NoThrowForwardIterator</span>
<span id="cb1-42"><a href="#cb1-42"></a>      uninitialized_value_construct_n(ExecutionPolicy&amp;&amp; exec,   // see [algorithms.parallel.overloads]</span>
<span id="cb1-43"><a href="#cb1-43"></a>                                      NoThrowForwardIterator first, Size n);</span>
<span id="cb1-44"><a href="#cb1-44"></a></span>
<span id="cb1-45"><a href="#cb1-45"></a>  namespace ranges {</span>
<span id="cb1-46"><a href="#cb1-46"></a>    template&lt;no-throw-forward-iterator I, no-throw-sentinel-for&lt;I&gt; S&gt;</span>
<span id="cb1-47"><a href="#cb1-47"></a>      requires default_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb1-48"><a href="#cb1-48"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> I uninitialized_value_construct(I first, S last);</span>
<span id="cb1-49"><a href="#cb1-49"></a>    template&lt;no-throw-forward-range R&gt;</span>
<span id="cb1-50"><a href="#cb1-50"></a>      requires default_initializable&lt;range_value_t&lt;R&gt;&gt;</span>
<span id="cb1-51"><a href="#cb1-51"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> borrowed_iterator_t&lt;R&gt; uninitialized_value_construct(R&amp;&amp; r);</span>
<span id="cb1-52"><a href="#cb1-52"></a></span>
<span id="cb1-53"><a href="#cb1-53"></a>    template&lt;no-throw-forward-iterator I&gt;</span>
<span id="cb1-54"><a href="#cb1-54"></a>      requires default_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb1-55"><a href="#cb1-55"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> I uninitialized_value_construct_n(I first, iter_difference_t&lt;I&gt; n);</span>
<span id="cb1-56"><a href="#cb1-56"></a>  }</span>
<span id="cb1-57"><a href="#cb1-57"></a></span>
<span id="cb1-58"><a href="#cb1-58"></a>  template&lt;class InputIterator, class NoThrowForwardIterator&gt;</span>
<span id="cb1-59"><a href="#cb1-59"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> NoThrowForwardIterator </span>
<span id="cb1-60"><a href="#cb1-60"></a>      uninitialized_copy(InputIterator first, InputIterator last,</span>
<span id="cb1-61"><a href="#cb1-61"></a>                         NoThrowForwardIterator result);</span>
<span id="cb1-62"><a href="#cb1-62"></a>  template&lt;class ExecutionPolicy, class InputIterator, class NoThrowForwardIterator&gt;</span>
<span id="cb1-63"><a href="#cb1-63"></a>    NoThrowForwardIterator uninitialized_copy(ExecutionPolicy&amp;&amp; exec,   // see [algorithms.parallel.overloads]</span>
<span id="cb1-64"><a href="#cb1-64"></a>                                              InputIterator first, InputIterator last,</span>
<span id="cb1-65"><a href="#cb1-65"></a>                                              NoThrowForwardIterator result);</span>
<span id="cb1-66"><a href="#cb1-66"></a>  template&lt;class InputIterator, class Size, class NoThrowForwardIterator&gt;</span>
<span id="cb1-67"><a href="#cb1-67"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> NoThrowForwardIterator </span>
<span id="cb1-68"><a href="#cb1-68"></a>      uninitialized_copy_n(InputIterator first, Size n, NoThrowForwardIterator result);</span>
<span id="cb1-69"><a href="#cb1-69"></a>  template&lt;class ExecutionPolicy, class InputIterator, class Size, class NoThrowForwardIterator&gt;</span>
<span id="cb1-70"><a href="#cb1-70"></a>    NoThrowForwardIterator uninitialized_copy_n(ExecutionPolicy&amp;&amp; exec, // see [algorithms.parallel.overloads]</span>
<span id="cb1-71"><a href="#cb1-71"></a>                                                InputIterator first, Size n,</span>
<span id="cb1-72"><a href="#cb1-72"></a>                                                NoThrowForwardIterator result);</span>
<span id="cb1-73"><a href="#cb1-73"></a></span>
<span id="cb1-74"><a href="#cb1-74"></a>  namespace ranges {</span>
<span id="cb1-75"><a href="#cb1-75"></a>    template&lt;class I, class O&gt;</span>
<span id="cb1-76"><a href="#cb1-76"></a>      using uninitialized_copy_result = in_out_result&lt;I, O&gt;;</span>
<span id="cb1-77"><a href="#cb1-77"></a>    template&lt;input_­iterator I, sentinel_­for&lt;I&gt; S1,</span>
<span id="cb1-78"><a href="#cb1-78"></a>             no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S2&gt;</span>
<span id="cb1-79"><a href="#cb1-79"></a>      requires constructible_­from&lt;iter_value_t&lt;O&gt;, iter_reference_t&lt;I&gt;&gt;</span>
<span id="cb1-80"><a href="#cb1-80"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> uninitialized_copy_result&lt;I, O&gt;</span>
<span id="cb1-81"><a href="#cb1-81"></a>          uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast);</span>
<span id="cb1-82"><a href="#cb1-82"></a>    template&lt;input_­range IR, no-throw-forward-range OR&gt;</span>
<span id="cb1-83"><a href="#cb1-83"></a>      requires constructible_­from&lt;range_value_t&lt;OR&gt;, range_reference_t&lt;IR&gt;&gt;</span>
<span id="cb1-84"><a href="#cb1-84"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> uninitialized_copy_result&lt;borrowed_iterator_t&lt;IR&gt;, borrowed_iterator_t&lt;OR&gt;&gt;</span>
<span id="cb1-85"><a href="#cb1-85"></a>          uninitialized_copy(IR&amp;&amp; in_range, OR&amp;&amp; out_range);</span>
<span id="cb1-86"><a href="#cb1-86"></a></span>
<span id="cb1-87"><a href="#cb1-87"></a>    template&lt;class I, class O&gt;</span>
<span id="cb1-88"><a href="#cb1-88"></a>      using uninitialized_copy_n_result = in_out_result&lt;I, O&gt;;</span>
<span id="cb1-89"><a href="#cb1-89"></a>    template&lt;input_­iterator I, no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S&gt;</span>
<span id="cb1-90"><a href="#cb1-90"></a>      requires constructible_­from&lt;iter_value_t&lt;O&gt;, iter_reference_t&lt;I&gt;&gt;</span>
<span id="cb1-91"><a href="#cb1-91"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> uninitialized_copy_n_result&lt;I, O&gt;</span>
<span id="cb1-92"><a href="#cb1-92"></a>          uninitialized_copy_n(I ifirst, iter_difference_t&lt;I&gt; n, O ofirst, S olast);</span>
<span id="cb1-93"><a href="#cb1-93"></a>  }</span>
<span id="cb1-94"><a href="#cb1-94"></a></span>
<span id="cb1-95"><a href="#cb1-95"></a>  template&lt;class InputIterator, class NoThrowForwardIterator&gt;</span>
<span id="cb1-96"><a href="#cb1-96"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> NoThrowForwardIterator </span>
<span id="cb1-97"><a href="#cb1-97"></a>      uninitialized_move(InputIterator first, InputIterator last,</span>
<span id="cb1-98"><a href="#cb1-98"></a>                         NoThrowForwardIterator result);</span>
<span id="cb1-99"><a href="#cb1-99"></a>  template&lt;class ExecutionPolicy, class InputIterator, class NoThrowForwardIterator&gt;</span>
<span id="cb1-100"><a href="#cb1-100"></a>    NoThrowForwardIterator uninitialized_move(ExecutionPolicy&amp;&amp; exec,   // see [algorithms.parallel.overloads]</span>
<span id="cb1-101"><a href="#cb1-101"></a>                                              InputIterator first, InputIterator last,</span>
<span id="cb1-102"><a href="#cb1-102"></a>                                              NoThrowForwardIterator result);</span>
<span id="cb1-103"><a href="#cb1-103"></a>  template&lt;class InputIterator, class Size, class NoThrowForwardIterator&gt;</span>
<span id="cb1-104"><a href="#cb1-104"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> pair&lt;InputIterator, NoThrowForwardIterator&gt;</span>
<span id="cb1-105"><a href="#cb1-105"></a>      uninitialized_move_n(InputIterator first, Size n, NoThrowForwardIterator result);</span>
<span id="cb1-106"><a href="#cb1-106"></a>  template&lt;class ExecutionPolicy, class InputIterator, class Size, class NoThrowForwardIterator&gt;</span>
<span id="cb1-107"><a href="#cb1-107"></a>    pair&lt;InputIterator, NoThrowForwardIterator&gt;</span>
<span id="cb1-108"><a href="#cb1-108"></a>      uninitialized_move_n(ExecutionPolicy&amp;&amp; exec,              // see [algorithms.parallel.overloads]</span>
<span id="cb1-109"><a href="#cb1-109"></a>                           InputIterator first, Size n, NoThrowForwardIterator result);</span>
<span id="cb1-110"><a href="#cb1-110"></a></span>
<span id="cb1-111"><a href="#cb1-111"></a>  namespace ranges {</span>
<span id="cb1-112"><a href="#cb1-112"></a>    template&lt;class I, class O&gt;</span>
<span id="cb1-113"><a href="#cb1-113"></a>      using uninitialized_move_result = in_out_result&lt;I, O&gt;;</span>
<span id="cb1-114"><a href="#cb1-114"></a>    template&lt;input_­iterator I, sentinel_­for&lt;I&gt; S1,</span>
<span id="cb1-115"><a href="#cb1-115"></a>             no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S2&gt;</span>
<span id="cb1-116"><a href="#cb1-116"></a>      requires constructible_­from&lt;iter_value_t&lt;O&gt;, iter_rvalue_reference_t&lt;I&gt;&gt;</span>
<span id="cb1-117"><a href="#cb1-117"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> uninitialized_move_result&lt;I, O&gt;</span>
<span id="cb1-118"><a href="#cb1-118"></a>          uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast);</span>
<span id="cb1-119"><a href="#cb1-119"></a>    template&lt;input_­range IR, no-throw-forward-range OR&gt;</span>
<span id="cb1-120"><a href="#cb1-120"></a>      requires constructible_­from&lt;range_value_t&lt;OR&gt;, range_rvalue_reference_t&lt;IR&gt;&gt;</span>
<span id="cb1-121"><a href="#cb1-121"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> uninitialized_move_result&lt;borrowed_iterator_t&lt;IR&gt;, borrowed_iterator_t&lt;OR&gt;&gt;</span>
<span id="cb1-122"><a href="#cb1-122"></a>          uninitialized_move(IR&amp;&amp; in_range, OR&amp;&amp; out_range);</span>
<span id="cb1-123"><a href="#cb1-123"></a></span>
<span id="cb1-124"><a href="#cb1-124"></a>    template&lt;class I, class O&gt;</span>
<span id="cb1-125"><a href="#cb1-125"></a>      using uninitialized_move_n_result = in_out_result&lt;I, O&gt;;</span>
<span id="cb1-126"><a href="#cb1-126"></a>    template&lt;input_­iterator I,</span>
<span id="cb1-127"><a href="#cb1-127"></a>             no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S&gt;</span>
<span id="cb1-128"><a href="#cb1-128"></a>      requires constructible_­from&lt;iter_value_t&lt;O&gt;, iter_rvalue_reference_t&lt;I&gt;&gt;</span>
<span id="cb1-129"><a href="#cb1-129"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> uninitialized_move_n_result&lt;I, O&gt;</span>
<span id="cb1-130"><a href="#cb1-130"></a>          uninitialized_move_n(I ifirst, iter_difference_t&lt;I&gt; n, O ofirst, S olast);</span>
<span id="cb1-131"><a href="#cb1-131"></a>  }</span>
<span id="cb1-132"><a href="#cb1-132"></a></span>
<span id="cb1-133"><a href="#cb1-133"></a>  template&lt;class NoThrowForwardIterator, class T&gt;</span>
<span id="cb1-134"><a href="#cb1-134"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> void uninitialized_fill(NoThrowForwardIterator first,</span>
<span id="cb1-135"><a href="#cb1-135"></a>                                      NoThrowForwardIterator last, const T&amp; x);</span>
<span id="cb1-136"><a href="#cb1-136"></a>  template&lt;class ExecutionPolicy, class NoThrowForwardIterator, class T&gt;</span>
<span id="cb1-137"><a href="#cb1-137"></a>    void uninitialized_fill(ExecutionPolicy&amp;&amp; exec,             // see [algorithms.parallel.overloads]</span>
<span id="cb1-138"><a href="#cb1-138"></a>                            NoThrowForwardIterator first, NoThrowForwardIterator last,</span>
<span id="cb1-139"><a href="#cb1-139"></a>                            const T&amp; x);</span>
<span id="cb1-140"><a href="#cb1-140"></a>  template&lt;class NoThrowForwardIterator, class Size, class T&gt;</span>
<span id="cb1-141"><a href="#cb1-141"></a>    <span class="add" style="color: #006e28"><ins>constexpr</ins></span> NoThrowForwardIterator</span>
<span id="cb1-142"><a href="#cb1-142"></a>      uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T&amp; x);</span>
<span id="cb1-143"><a href="#cb1-143"></a>  template&lt;class ExecutionPolicy, class NoThrowForwardIterator, class Size, class T&gt;</span>
<span id="cb1-144"><a href="#cb1-144"></a>    NoThrowForwardIterator</span>
<span id="cb1-145"><a href="#cb1-145"></a>      uninitialized_fill_n(ExecutionPolicy&amp;&amp; exec,              // see [algorithms.parallel.overloads]</span>
<span id="cb1-146"><a href="#cb1-146"></a>                           NoThrowForwardIterator first, Size n, const T&amp; x);</span>
<span id="cb1-147"><a href="#cb1-147"></a></span>
<span id="cb1-148"><a href="#cb1-148"></a>  namespace ranges {</span>
<span id="cb1-149"><a href="#cb1-149"></a>    template&lt;no-throw-forward-iterator I, no-throw-sentinel-for&lt;I&gt; S, class T&gt;</span>
<span id="cb1-150"><a href="#cb1-150"></a>      requires constructible_­from&lt;iter_value_t&lt;I&gt;, const T&amp;&gt;</span>
<span id="cb1-151"><a href="#cb1-151"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> I uninitialized_fill(I first, S last, const T&amp; x);</span>
<span id="cb1-152"><a href="#cb1-152"></a>    template&lt;no-throw-forward-range R, class T&gt;</span>
<span id="cb1-153"><a href="#cb1-153"></a>      requires constructible_­from&lt;range_value_t&lt;R&gt;, const T&amp;&gt;</span>
<span id="cb1-154"><a href="#cb1-154"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> borrowed_iterator_t&lt;R&gt; uninitialized_fill(R&amp;&amp; r, const T&amp; x);</span>
<span id="cb1-155"><a href="#cb1-155"></a></span>
<span id="cb1-156"><a href="#cb1-156"></a>    template&lt;no-throw-forward-iterator I, class T&gt;</span>
<span id="cb1-157"><a href="#cb1-157"></a>      requires constructible_­from&lt;iter_value_t&lt;I&gt;, const T&amp;&gt;</span>
<span id="cb1-158"><a href="#cb1-158"></a>        <span class="add" style="color: #006e28"><ins>constexpr</ins></span> I uninitialized_fill_n(I first, iter_difference_t&lt;I&gt; n, const T&amp; x);</span>
<span id="cb1-159"><a href="#cb1-159"></a>  }</span>
<span id="cb1-160"><a href="#cb1-160"></a></span>
<span id="cb1-161"><a href="#cb1-161"></a>  // [specialized.construct], construct_­at</span>
<span id="cb1-162"><a href="#cb1-162"></a>  template&lt;class T, class... Args&gt;</span>
<span id="cb1-163"><a href="#cb1-163"></a>    constexpr T* construct_at(T* location, Args&amp;&amp;... args);</span>
<span id="cb1-164"><a href="#cb1-164"></a></span>
<span id="cb1-165"><a href="#cb1-165"></a>  namespace ranges {</span>
<span id="cb1-166"><a href="#cb1-166"></a>    template&lt;class T, class... Args&gt;</span>
<span id="cb1-167"><a href="#cb1-167"></a>      constexpr T* construct_at(T* location, Args&amp;&amp;... args);</span>
<span id="cb1-168"><a href="#cb1-168"></a>  }</span></code></pre></div>
<div class="add" style="color: #006e28">

<div class="sourceCode" id="cb2"><pre class="sourceCode default default"><code class="sourceCode default"><span id="cb2-1"><a href="#cb2-1"></a>  // [specialized.default_construct], default_construct_at</span>
<span id="cb2-2"><a href="#cb2-2"></a>  template&lt;class T&gt;</span>
<span id="cb2-3"><a href="#cb2-3"></a>    constexpr T* default_construct_at(T* location);</span>
<span id="cb2-4"><a href="#cb2-4"></a></span>
<span id="cb2-5"><a href="#cb2-5"></a>  namespace ranges {</span>
<span id="cb2-6"><a href="#cb2-6"></a>    template&lt;class T&gt;</span>
<span id="cb2-7"><a href="#cb2-7"></a>      constexpr T* default_construct_at(T* location);</span>
<span id="cb2-8"><a href="#cb2-8"></a>  }</span></code></pre></div>

</div>
<h2 data-number="4.3" id="modify-25.11.3-uninitialized.construct.default-of-n4762-as-follows"><span class="header-section-number">4.3</span> Modify <strong>25.11.3 [uninitialized.construct.default]</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-25.11.3-uninitialized.construct.default-of-n4762-as-follows" class="self-link"></a></h2>
<div>
<div class="sourceCode" id="cb3"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb3-1"><a href="#cb3-1"></a>    template&lt;class NoThrowForwardIterator&gt;</span>
<span id="cb3-2"><a href="#cb3-2"></a><span class="st">-     void uninitialized_default_construct(NoThrowForwardIterator first, NoThrowForwardIterator last);</span></span>
<span id="cb3-3"><a href="#cb3-3"></a><span class="va">+     constexpr void uninitialized_default_construct(NoThrowForwardIterator first, </span></span>
<span id="cb3-4"><a href="#cb3-4"></a><span class="va">+                                                    NoThrowForwardIterator last);</span></span>
<span id="cb3-5"><a href="#cb3-5"></a></span>
<span id="cb3-6"><a href="#cb3-6"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb3-7"><a href="#cb3-7"></a>    for (; first != last; ++first)</span>
<span id="cb3-8"><a href="#cb3-8"></a><span class="st">-     ::new (voidify(*first)) typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type;</span></span>
<span id="cb3-9"><a href="#cb3-9"></a><span class="va">+     default_construct_at(to_address(first));</span></span>
<span id="cb3-10"><a href="#cb3-10"></a></span>
<span id="cb3-11"><a href="#cb3-11"></a>  namespace ranges {</span>
<span id="cb3-12"><a href="#cb3-12"></a>    template&lt;no-throw-forward-iterator I, no-throw-sentinel-for&lt;I&gt; S&gt;</span>
<span id="cb3-13"><a href="#cb3-13"></a>      requires default_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb3-14"><a href="#cb3-14"></a><span class="st">-     I uninitialized_default_construct(I first, S last);</span></span>
<span id="cb3-15"><a href="#cb3-15"></a><span class="va">+     constexpr I uninitialized_default_construct(I first, S last);</span></span>
<span id="cb3-16"><a href="#cb3-16"></a>    template&lt;no-throw-forward-range R&gt;</span>
<span id="cb3-17"><a href="#cb3-17"></a>      requires default_initializable&lt;range_value_t&lt;R&gt;&gt;</span>
<span id="cb3-18"><a href="#cb3-18"></a><span class="st">-     borrowed_iterator_t&lt;R&gt; uninitialized_default_construct(R&amp;&amp; r);</span></span>
<span id="cb3-19"><a href="#cb3-19"></a><span class="va">+     constexpr borrowed_iterator_t&lt;R&gt; uninitialized_default_construct(R&amp;&amp; r);</span></span>
<span id="cb3-20"><a href="#cb3-20"></a>  }</span>
<span id="cb3-21"><a href="#cb3-21"></a></span>
<span id="cb3-22"><a href="#cb3-22"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb3-23"><a href="#cb3-23"></a>    for (; first != last; ++first)</span>
<span id="cb3-24"><a href="#cb3-24"></a><span class="st">-     ::new (voidify(*first)) remove_reference_t&lt;iter_reference_t&lt;I&gt;&gt;;</span></span>
<span id="cb3-25"><a href="#cb3-25"></a><span class="va">+     default_construct_at(to_address(first));</span></span>
<span id="cb3-26"><a href="#cb3-26"></a>    return first;</span>
<span id="cb3-27"><a href="#cb3-27"></a></span>
<span id="cb3-28"><a href="#cb3-28"></a>  template&lt;class NoThrowForwardIterator, class Size&gt;</span>
<span id="cb3-29"><a href="#cb3-29"></a><span class="st">-   NoThrowForwardIterator uninitialized_default_construct_n(NoThrowForwardIterator first, Size n);</span></span>
<span id="cb3-30"><a href="#cb3-30"></a><span class="va">+   constexpr NoThrowForwardIterator </span></span>
<span id="cb3-31"><a href="#cb3-31"></a><span class="va">+     uninitialized_default_construct_n(NoThrowForwardIterator first, Size n);</span></span>
<span id="cb3-32"><a href="#cb3-32"></a></span>
<span id="cb3-33"><a href="#cb3-33"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb3-34"><a href="#cb3-34"></a>    for (; n &gt; 0; (void)++first, --n)</span>
<span id="cb3-35"><a href="#cb3-35"></a><span class="st">-     ::new (voidify(*first)) typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type;</span></span>
<span id="cb3-36"><a href="#cb3-36"></a><span class="va">+     default_construct_at(to_address(first));</span></span>
<span id="cb3-37"><a href="#cb3-37"></a>    return first;</span>
<span id="cb3-38"><a href="#cb3-38"></a></span>
<span id="cb3-39"><a href="#cb3-39"></a>  namespace ranges {</span>
<span id="cb3-40"><a href="#cb3-40"></a>    template&lt;no-throw-forward-iterator I&gt;</span>
<span id="cb3-41"><a href="#cb3-41"></a>      requires default_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb3-42"><a href="#cb3-42"></a><span class="st">-     I uninitialized_default_construct_n(I first, iter_difference_t&lt;I&gt; n);</span></span>
<span id="cb3-43"><a href="#cb3-43"></a><span class="va">+     constexpr I uninitialized_default_construct_n(I first, iter_difference_t&lt;I&gt; n);</span></span>
<span id="cb3-44"><a href="#cb3-44"></a>  }</span>
<span id="cb3-45"><a href="#cb3-45"></a></span>
<span id="cb3-46"><a href="#cb3-46"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb3-47"><a href="#cb3-47"></a>    return uninitialized_default_construct(counted_iterator(first, n),</span>
<span id="cb3-48"><a href="#cb3-48"></a>                                           default_sentinel).base();</span></code></pre></div>
</div>
<h2 data-number="4.4" id="modify-25.11.4-uninitialized.construct.value-of-n4762-as-follows"><span class="header-section-number">4.4</span> Modify <strong>25.11.4 [uninitialized.construct.value]</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-25.11.4-uninitialized.construct.value-of-n4762-as-follows" class="self-link"></a></h2>
<div>
<div class="sourceCode" id="cb4"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb4-1"><a href="#cb4-1"></a>  template&lt;class NoThrowForwardIterator&gt;</span>
<span id="cb4-2"><a href="#cb4-2"></a><span class="st">-   void uninitialized_value_construct(NoThrowForwardIterator first, NoThrowForwardIterator last);</span></span>
<span id="cb4-3"><a href="#cb4-3"></a><span class="va">+   constexpr void uninitialized_value_construct(NoThrowForwardIterator first,</span></span>
<span id="cb4-4"><a href="#cb4-4"></a><span class="va">+                                                NoThrowForwardIterator last);</span></span>
<span id="cb4-5"><a href="#cb4-5"></a></span>
<span id="cb4-6"><a href="#cb4-6"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb4-7"><a href="#cb4-7"></a>    for (; first != last; ++first)</span>
<span id="cb4-8"><a href="#cb4-8"></a><span class="st">-     ::new (voidify(*first)) typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type();</span></span>
<span id="cb4-9"><a href="#cb4-9"></a><span class="va">+     construct_at(to_address(first));</span></span>
<span id="cb4-10"><a href="#cb4-10"></a></span>
<span id="cb4-11"><a href="#cb4-11"></a>  namespace ranges {</span>
<span id="cb4-12"><a href="#cb4-12"></a>    template&lt;no-throw-forward-iterator I, no-throw-sentinel-for&lt;I&gt; S&gt;</span>
<span id="cb4-13"><a href="#cb4-13"></a>      requires value_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb4-14"><a href="#cb4-14"></a><span class="st">-     I uninitialized_value_construct(I first, S last);</span></span>
<span id="cb4-15"><a href="#cb4-15"></a><span class="va">+     constexpr I uninitialized_value_construct(I first, S last);</span></span>
<span id="cb4-16"><a href="#cb4-16"></a>    template&lt;no-throw-forward-range R&gt;</span>
<span id="cb4-17"><a href="#cb4-17"></a>      requires value_initializable&lt;range_value_t&lt;R&gt;&gt;</span>
<span id="cb4-18"><a href="#cb4-18"></a><span class="st">-     borrowed_iterator_t&lt;R&gt; uninitialized_value_construct(R&amp;&amp; r);</span></span>
<span id="cb4-19"><a href="#cb4-19"></a><span class="va">+     constexpr borrowed_iterator_t&lt;R&gt; uninitialized_value_construct(R&amp;&amp; r);</span></span>
<span id="cb4-20"><a href="#cb4-20"></a>  }</span>
<span id="cb4-21"><a href="#cb4-21"></a></span>
<span id="cb4-22"><a href="#cb4-22"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb4-23"><a href="#cb4-23"></a>    for (; first != last; ++first)</span>
<span id="cb4-24"><a href="#cb4-24"></a><span class="st">-     ::new (voidify(*first)) remove_reference_t&lt;iter_reference_t&lt;I&gt;&gt;();</span></span>
<span id="cb4-25"><a href="#cb4-25"></a><span class="va">+     construct_at(to_address(first));</span></span>
<span id="cb4-26"><a href="#cb4-26"></a>    return first;</span>
<span id="cb4-27"><a href="#cb4-27"></a></span>
<span id="cb4-28"><a href="#cb4-28"></a>  template&lt;class NoThrowForwardIterator, class Size&gt;</span>
<span id="cb4-29"><a href="#cb4-29"></a><span class="st">-   NoThrowForwardIterator uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);</span></span>
<span id="cb4-30"><a href="#cb4-30"></a><span class="va">+   constexpr NoThrowForwardIterator </span></span>
<span id="cb4-31"><a href="#cb4-31"></a><span class="va">+     uninitialized_value_construct_n(NoThrowForwardIterator first, Size n);</span></span>
<span id="cb4-32"><a href="#cb4-32"></a></span>
<span id="cb4-33"><a href="#cb4-33"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb4-34"><a href="#cb4-34"></a>    for (; n &gt; 0; (void)++first, --n)</span>
<span id="cb4-35"><a href="#cb4-35"></a><span class="st">-     ::new (voidify(*first)) typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type();</span></span>
<span id="cb4-36"><a href="#cb4-36"></a><span class="va">+     construct_at(to_address(first));</span></span>
<span id="cb4-37"><a href="#cb4-37"></a>    return first;</span>
<span id="cb4-38"><a href="#cb4-38"></a></span>
<span id="cb4-39"><a href="#cb4-39"></a>  namespace ranges {</span>
<span id="cb4-40"><a href="#cb4-40"></a>    template&lt;no-throw-forward-iterator I&gt;</span>
<span id="cb4-41"><a href="#cb4-41"></a>      requires value_initializable&lt;iter_value_t&lt;I&gt;&gt;</span>
<span id="cb4-42"><a href="#cb4-42"></a><span class="st">-     I uninitialized_value_construct_n(I first, iter_difference_t&lt;I&gt; n);</span></span>
<span id="cb4-43"><a href="#cb4-43"></a><span class="va">+     constexpr I uninitialized_value_construct_n(I first, iter_difference_t&lt;I&gt; n);</span></span>
<span id="cb4-44"><a href="#cb4-44"></a>  }</span>
<span id="cb4-45"><a href="#cb4-45"></a></span>
<span id="cb4-46"><a href="#cb4-46"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb4-47"><a href="#cb4-47"></a>    return uninitialized_value_construct(counted_iterator(first, n),</span>
<span id="cb4-48"><a href="#cb4-48"></a>                                         value_sentinel).base();</span></code></pre></div>
</div>
<h2 data-number="4.5" id="modify-25.11.5-uninitialized.copy-of-n4762-as-follows"><span class="header-section-number">4.5</span> Modify <strong>25.11.5 [uninitialized.copy]</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-25.11.5-uninitialized.copy-of-n4762-as-follows" class="self-link"></a></h2>
<div>
<div class="sourceCode" id="cb5"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb5-1"><a href="#cb5-1"></a>  template&lt;class InputIterator, class NoThrowForwardIterator&gt;</span>
<span id="cb5-2"><a href="#cb5-2"></a><span class="st">-   NoThrowForwardIterator uninitialized_copy(InputIterator first, InputIterator last,</span></span>
<span id="cb5-3"><a href="#cb5-3"></a><span class="st">-                                             NoThrowForwardIterator result);</span></span>
<span id="cb5-4"><a href="#cb5-4"></a><span class="va">+   constexpr NoThrowForwardIterator </span></span>
<span id="cb5-5"><a href="#cb5-5"></a><span class="va">+     uninitialized_copy(InputIterator first, InputIterator last, </span></span>
<span id="cb5-6"><a href="#cb5-6"></a><span class="va">+                        NoThrowForwardIterator result);</span></span>
<span id="cb5-7"><a href="#cb5-7"></a></span>
<span id="cb5-8"><a href="#cb5-8"></a>  <em>Preconditions:</em> </span>
<span id="cb5-9"><a href="#cb5-9"></a>    result + [0, (last - first)) does not overlap with [first, last).</span>
<span id="cb5-10"><a href="#cb5-10"></a></span>
<span id="cb5-11"><a href="#cb5-11"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb5-12"><a href="#cb5-12"></a>    for (; first != last; ++result, (void) ++first)</span>
<span id="cb5-13"><a href="#cb5-13"></a><span class="st">-     ::new (voidify(*result))</span></span>
<span id="cb5-14"><a href="#cb5-14"></a><span class="st">-       typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type(*first);</span></span>
<span id="cb5-15"><a href="#cb5-15"></a><span class="va">+     construct_at(to_address(result), *first);</span></span>
<span id="cb5-16"><a href="#cb5-16"></a></span>
<span id="cb5-17"><a href="#cb5-17"></a>  <em>Returns:</em> result.</span>
<span id="cb5-18"><a href="#cb5-18"></a></span>
<span id="cb5-19"><a href="#cb5-19"></a>  namespace ranges {</span>
<span id="cb5-20"><a href="#cb5-20"></a>    template&lt;input_iterator I, sentinel_for&lt;I&gt; S1,</span>
<span id="cb5-21"><a href="#cb5-21"></a>            no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S2&gt;</span>
<span id="cb5-22"><a href="#cb5-22"></a>      requires constructible_from&lt;iter_value_t&lt;O&gt;, iter_reference_t&lt;I&gt;&gt;</span>
<span id="cb5-23"><a href="#cb5-23"></a><span class="st">-     uninitialized_copy_result&lt;I, O&gt;</span></span>
<span id="cb5-24"><a href="#cb5-24"></a><span class="va">+     constexpr uninitialized_copy_result&lt;I, O&gt;</span></span>
<span id="cb5-25"><a href="#cb5-25"></a>        uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast);</span>
<span id="cb5-26"><a href="#cb5-26"></a>    template&lt;input_­range IR, no-throw-forward-range OR&gt;</span>
<span id="cb5-27"><a href="#cb5-27"></a>      requires constructible_from&lt;range_value_t&lt;OR&gt;, range_reference_t&lt;IR&gt;&gt;</span>
<span id="cb5-28"><a href="#cb5-28"></a><span class="st">-     uninitialized_copy_result&lt;borrowed_iterator_t&lt;IR&gt;, borrowed_iterator_t&lt;OR&gt;&gt;</span></span>
<span id="cb5-29"><a href="#cb5-29"></a><span class="va">+     constexpr uninitialized_copy_result&lt;borrowed_iterator_t&lt;IR&gt;, borrowed_iterator_t&lt;OR&gt;&gt;</span></span>
<span id="cb5-30"><a href="#cb5-30"></a>        uninitialized_copy(IR&amp;&amp; in_range, OR&amp;&amp; out_range);</span>
<span id="cb5-31"><a href="#cb5-31"></a>  }</span>
<span id="cb5-32"><a href="#cb5-32"></a></span>
<span id="cb5-33"><a href="#cb5-33"></a>  <em>Preconditions:</em> </span>
<span id="cb5-34"><a href="#cb5-34"></a>    [ofirst, olast) does not overlap with [ifirst, ilast).</span>
<span id="cb5-35"><a href="#cb5-35"></a></span>
<span id="cb5-36"><a href="#cb5-36"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb5-37"><a href="#cb5-37"></a>    for (; ifirst != ilast &amp;&amp; ofirst != olast; ++ofirst, (void)++ifirst)</span>
<span id="cb5-38"><a href="#cb5-38"></a><span class="st">-     ::new (voidify(*ofirst)) remove_reference_t&lt;iter_reference_t&lt;O&gt;&gt;(*ifirst);</span></span>
<span id="cb5-39"><a href="#cb5-39"></a><span class="va">+     construct_at(to_address(ofirst), *ifirst);</span></span>
<span id="cb5-40"><a href="#cb5-40"></a>    return {std::move(ifirst), ofirst};</span>
<span id="cb5-41"><a href="#cb5-41"></a></span>
<span id="cb5-42"><a href="#cb5-42"></a>  template&lt;class InputIterator, class Size, class NoThrowForwardIterator&gt;</span>
<span id="cb5-43"><a href="#cb5-43"></a><span class="st">-   NoThrowForwardIterator uninitialized_copy_n(InputIterator first, Size n,</span></span>
<span id="cb5-44"><a href="#cb5-44"></a><span class="st">-                                               NoThrowForwardIterator result);</span></span>
<span id="cb5-45"><a href="#cb5-45"></a><span class="va">+   constexpr NoThrowForwardIterator </span></span>
<span id="cb5-46"><a href="#cb5-46"></a><span class="va">+     uninitialized_copy_n(InputIterator first, Size n, NoThrowForwardIterator result);</span></span>
<span id="cb5-47"><a href="#cb5-47"></a></span>
<span id="cb5-48"><a href="#cb5-48"></a>  <em>Preconditions:</em> </span>
<span id="cb5-49"><a href="#cb5-49"></a>    result + [0, n) does not overlap with first + [0, n).</span>
<span id="cb5-50"><a href="#cb5-50"></a></span>
<span id="cb5-51"><a href="#cb5-51"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb5-52"><a href="#cb5-52"></a>    for ( ; n &gt; 0; ++result, (void) ++first, --n)</span>
<span id="cb5-53"><a href="#cb5-53"></a><span class="st">-     ::new (voidify(*result))</span></span>
<span id="cb5-54"><a href="#cb5-54"></a><span class="st">-       typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type(*first);</span></span>
<span id="cb5-55"><a href="#cb5-55"></a><span class="va">+     construct_at(to_address(result), *first);</span></span>
<span id="cb5-56"><a href="#cb5-56"></a></span>
<span id="cb5-57"><a href="#cb5-57"></a>  <em>Returns:</em> result.</span>
<span id="cb5-58"><a href="#cb5-58"></a></span>
<span id="cb5-59"><a href="#cb5-59"></a>  namespace ranges {</span>
<span id="cb5-60"><a href="#cb5-60"></a>    template&lt;input_iterator I, no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S&gt;</span>
<span id="cb5-61"><a href="#cb5-61"></a>      requires constructible_from&lt;iter_value_t&lt;O&gt;, iter_reference_t&lt;I&gt;&gt;</span>
<span id="cb5-62"><a href="#cb5-62"></a><span class="st">-     uninitialized_copy_n_result&lt;I, O&gt;</span></span>
<span id="cb5-63"><a href="#cb5-63"></a><span class="va">+     constexpr uninitialized_copy_n_result&lt;I, O&gt;</span></span>
<span id="cb5-64"><a href="#cb5-64"></a>        uninitialized_copy_n(I ifirst, iter_difference_t&lt;I&gt; n, O ofirst, S olast);</span>
<span id="cb5-65"><a href="#cb5-65"></a>  }</span>
<span id="cb5-66"><a href="#cb5-66"></a></span>
<span id="cb5-67"><a href="#cb5-67"></a>  <em>Preconditions:</em> </span>
<span id="cb5-68"><a href="#cb5-68"></a>    [ofirst, olast) does not overlap with ifirst + [0, n).</span>
<span id="cb5-69"><a href="#cb5-69"></a></span>
<span id="cb5-70"><a href="#cb5-70"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb5-71"><a href="#cb5-71"></a>    auto t = uninitialized_copy(counted_iterator(ifirst, n),</span>
<span id="cb5-72"><a href="#cb5-72"></a>                                default_sentinel, ofirst, olast);</span>
<span id="cb5-73"><a href="#cb5-73"></a>    return {std::move(t.in).base(), t.out};</span></code></pre></div>
</div>
<h2 data-number="4.6" id="modify-25.11.6-uninitialized.move-of-n4762-as-follows"><span class="header-section-number">4.6</span> Modify <strong>25.11.6 [uninitialized.move]</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-25.11.6-uninitialized.move-of-n4762-as-follows" class="self-link"></a></h2>
<div>
<div class="sourceCode" id="cb6"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb6-1"><a href="#cb6-1"></a>  template&lt;class InputIterator, class NoThrowForwardIterator&gt;</span>
<span id="cb6-2"><a href="#cb6-2"></a><span class="st">-   NoThrowForwardIterator uninitialized_move(InputIterator first, InputIterator last,</span></span>
<span id="cb6-3"><a href="#cb6-3"></a><span class="st">-                                             NoThrowForwardIterator result);</span></span>
<span id="cb6-4"><a href="#cb6-4"></a><span class="va">+   constexpr NoThrowForwardIterator </span></span>
<span id="cb6-5"><a href="#cb6-5"></a><span class="va">+     uninitialized_move(InputIterator first, InputIterator last, NoThrowForwardIterator result);</span></span>
<span id="cb6-6"><a href="#cb6-6"></a></span>
<span id="cb6-7"><a href="#cb6-7"></a>  <em>Preconditions:</em> </span>
<span id="cb6-8"><a href="#cb6-8"></a>    result + [0, (last - first)) does not overlap with [first, last).</span>
<span id="cb6-9"><a href="#cb6-9"></a></span>
<span id="cb6-10"><a href="#cb6-10"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb6-11"><a href="#cb6-11"></a>    for (; first != last; ++result, (void) ++first)</span>
<span id="cb6-12"><a href="#cb6-12"></a><span class="st">-     ::new (voidify(*result))</span></span>
<span id="cb6-13"><a href="#cb6-13"></a><span class="st">-       typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type(std::move(*first));</span></span>
<span id="cb6-14"><a href="#cb6-14"></a><span class="va">+     construct_at(to_address(result), std::move(*first));</span></span>
<span id="cb6-15"><a href="#cb6-15"></a></span>
<span id="cb6-16"><a href="#cb6-16"></a>  <em>Returns:</em> result.</span>
<span id="cb6-17"><a href="#cb6-17"></a></span>
<span id="cb6-18"><a href="#cb6-18"></a>  namespace ranges {</span>
<span id="cb6-19"><a href="#cb6-19"></a>    template&lt;input_iterator I, sentinel_for&lt;I&gt; S1,</span>
<span id="cb6-20"><a href="#cb6-20"></a>            no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S2&gt;</span>
<span id="cb6-21"><a href="#cb6-21"></a>      requires constructible_from&lt;iter_value_t&lt;O&gt;, iter_rvalue_reference_t&lt;I&gt;&gt;</span>
<span id="cb6-22"><a href="#cb6-22"></a><span class="st">-     uninitialized_move_result&lt;I, O&gt;</span></span>
<span id="cb6-23"><a href="#cb6-23"></a><span class="va">+     constexpr uninitialized_move_result&lt;I, O&gt;</span></span>
<span id="cb6-24"><a href="#cb6-24"></a>        uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast);</span>
<span id="cb6-25"><a href="#cb6-25"></a>    template&lt;input_­range IR, no-throw-forward-range OR&gt;</span>
<span id="cb6-26"><a href="#cb6-26"></a>      requires constructible_from&lt;range_value_t&lt;OR&gt;, range_rvalue_reference_t&lt;IR&gt;&gt;</span>
<span id="cb6-27"><a href="#cb6-27"></a><span class="st">-     uninitialized_move_result&lt;borrowed_iterator_t&lt;IR&gt;, borrowed_iterator_t&lt;OR&gt;&gt;</span></span>
<span id="cb6-28"><a href="#cb6-28"></a><span class="va">+     constexpr uninitialized_move_result&lt;borrowed_iterator_t&lt;IR&gt;, borrowed_iterator_t&lt;OR&gt;&gt;</span></span>
<span id="cb6-29"><a href="#cb6-29"></a>        uninitialized_move(IR&amp;&amp; in_range, OR&amp;&amp; out_range);</span>
<span id="cb6-30"><a href="#cb6-30"></a>  }</span>
<span id="cb6-31"><a href="#cb6-31"></a></span>
<span id="cb6-32"><a href="#cb6-32"></a>  <em>Preconditions:</em> </span>
<span id="cb6-33"><a href="#cb6-33"></a>    [ofirst, olast) does not overlap with [ifirst, ilast).</span>
<span id="cb6-34"><a href="#cb6-34"></a>    </span>
<span id="cb6-35"><a href="#cb6-35"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb6-36"><a href="#cb6-36"></a>    for (; ifirst != ilast &amp;&amp; ofirst != olast; ++ofirst, (void)++ifirst)</span>
<span id="cb6-37"><a href="#cb6-37"></a><span class="st">-     ::new (voidify(*ofirst)) </span></span>
<span id="cb6-38"><a href="#cb6-38"></a><span class="st">-       remove_reference_t&lt;iter_reference_t&lt;O&gt;&gt;(ranges::iter_move(ifirst);</span></span>
<span id="cb6-39"><a href="#cb6-39"></a><span class="va">+     construct_at(to_address(ofirst), ranges::iter_move(ifirst);</span></span>
<span id="cb6-40"><a href="#cb6-40"></a>    return {std::move(ifirst), ofirst};</span>
<span id="cb6-41"><a href="#cb6-41"></a></span>
<span id="cb6-42"><a href="#cb6-42"></a>  [Note 1: If an exception is thrown, some objects in the range [first, last) are left in a valid, but unspecified state. — end note]</span>
<span id="cb6-43"><a href="#cb6-43"></a></span>
<span id="cb6-44"><a href="#cb6-44"></a>  template&lt;class InputIterator, class Size, class NoThrowForwardIterator&gt;</span>
<span id="cb6-45"><a href="#cb6-45"></a><span class="st">-   NoThrowForwardIterator uninitialized_move_n(InputIterator first, Size n,</span></span>
<span id="cb6-46"><a href="#cb6-46"></a><span class="st">-                                               NoThrowForwardIterator result);</span></span>
<span id="cb6-47"><a href="#cb6-47"></a><span class="va">+   constexpr NoThrowForwardIterator </span></span>
<span id="cb6-48"><a href="#cb6-48"></a><span class="va">+     uninitialized_move_n(InputIterator first, Size n, NoThrowForwardIterator result);</span></span>
<span id="cb6-49"><a href="#cb6-49"></a></span>
<span id="cb6-50"><a href="#cb6-50"></a>  <em>Preconditions:</em> </span>
<span id="cb6-51"><a href="#cb6-51"></a>    result + [0, n) does not overlap with first + [0, n).</span>
<span id="cb6-52"><a href="#cb6-52"></a></span>
<span id="cb6-53"><a href="#cb6-53"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb6-54"><a href="#cb6-54"></a>    for ( ; n &gt; 0; ++result, (void) ++first, --n)</span>
<span id="cb6-55"><a href="#cb6-55"></a><span class="st">-     ::new (voidify(*result))</span></span>
<span id="cb6-56"><a href="#cb6-56"></a><span class="st">-       typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type(std::move(*first));</span></span>
<span id="cb6-57"><a href="#cb6-57"></a><span class="va">+     construct_at(to_address(result), std::move(*first));</span></span>
<span id="cb6-58"><a href="#cb6-58"></a>  <em>Returns:</em> result.</span>
<span id="cb6-59"><a href="#cb6-59"></a></span>
<span id="cb6-60"><a href="#cb6-60"></a>  namespace ranges {</span>
<span id="cb6-61"><a href="#cb6-61"></a>    template&lt;input_iterator I, no-throw-forward-iterator O, no-throw-sentinel-for&lt;O&gt; S&gt;</span>
<span id="cb6-62"><a href="#cb6-62"></a>      requires constructible_from&lt;iter_value_t&lt;O&gt;, iter_rvalue_reference_t&lt;I&gt;&gt;</span>
<span id="cb6-63"><a href="#cb6-63"></a><span class="st">-     uninitialized_move_n_result&lt;I, O&gt;</span></span>
<span id="cb6-64"><a href="#cb6-64"></a><span class="va">+     constexpr uninitialized_move_n_result&lt;I, O&gt;</span></span>
<span id="cb6-65"><a href="#cb6-65"></a>        uninitialized_move_n(I ifirst, iter_difference_t&lt;I&gt; n, O ofirst, S olast);</span>
<span id="cb6-66"><a href="#cb6-66"></a>  }</span>
<span id="cb6-67"><a href="#cb6-67"></a></span>
<span id="cb6-68"><a href="#cb6-68"></a>  <em>Preconditions:</em> </span>
<span id="cb6-69"><a href="#cb6-69"></a>    [ofirst, olast) does not overlap with ifirst + [0, n).</span>
<span id="cb6-70"><a href="#cb6-70"></a></span>
<span id="cb6-71"><a href="#cb6-71"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb6-72"><a href="#cb6-72"></a>    auto t = uninitialized_move(counted_iterator(ifirst, n),</span>
<span id="cb6-73"><a href="#cb6-73"></a>                                default_sentinel, ofirst, olast);</span>
<span id="cb6-74"><a href="#cb6-74"></a>    return {std::move(t.in).base(), t.out};</span>
<span id="cb6-75"><a href="#cb6-75"></a></span>
<span id="cb6-76"><a href="#cb6-76"></a>  [Note 2: If an exception is thrown, some objects in the range first + [0, n) are left in a valid but unspecified state. — end note]</span></code></pre></div>
</div>
<h2 data-number="4.7" id="modify-25.11.7-uninitialized.fill-of-n4762-as-follows"><span class="header-section-number">4.7</span> Modify <strong>25.11.7 [uninitialized.fill]</strong> of <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span> as follows<a href="#modify-25.11.7-uninitialized.fill-of-n4762-as-follows" class="self-link"></a></h2>
<div>
<div class="sourceCode" id="cb7"><pre class="sourceCode diff"><code class="sourceCode diff"><span id="cb7-1"><a href="#cb7-1"></a>  template&lt;class NoThrowForwardIterator, class T&gt;</span>
<span id="cb7-2"><a href="#cb7-2"></a><span class="st">-   void uninitialized_fill(NoThrowForwardIterator first, NoThrowForwardIterator last, const T&amp; x);</span></span>
<span id="cb7-3"><a href="#cb7-3"></a><span class="va">+   constexpr void uninitialized_fill(NoThrowForwardIterator first, </span></span>
<span id="cb7-4"><a href="#cb7-4"></a><span class="va">+                                     NoThrowForwardIterator last, const T&amp; x);</span></span>
<span id="cb7-5"><a href="#cb7-5"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb7-6"><a href="#cb7-6"></a>    for (; first != last; ++first)</span>
<span id="cb7-7"><a href="#cb7-7"></a><span class="st">-     ::new (voidify(*first))</span></span>
<span id="cb7-8"><a href="#cb7-8"></a><span class="st">-       typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type(x);</span></span>
<span id="cb7-9"><a href="#cb7-9"></a><span class="va">+     construct_at(to_address(first), x);</span></span>
<span id="cb7-10"><a href="#cb7-10"></a></span>
<span id="cb7-11"><a href="#cb7-11"></a>  namespace ranges {</span>
<span id="cb7-12"><a href="#cb7-12"></a>    template&lt;no-throw-forward-iterator I, no-throw-sentinel-for&lt;I&gt; S, class T&gt;</span>
<span id="cb7-13"><a href="#cb7-13"></a>      requires constructible_from&lt;iter_value_t&lt;I&gt;, const T&amp;&gt;</span>
<span id="cb7-14"><a href="#cb7-14"></a><span class="st">-     I uninitialized_fill(I first, S last, const T&amp; x);</span></span>
<span id="cb7-15"><a href="#cb7-15"></a><span class="va">+     constexpr I uninitialized_fill(I first, S last, const T&amp; x);</span></span>
<span id="cb7-16"><a href="#cb7-16"></a>    template&lt;no-throw-forward-range R, class T&gt;</span>
<span id="cb7-17"><a href="#cb7-17"></a>      requires constructible_from&lt;range_value_t&lt;R&gt;, const T&amp;&gt;</span>
<span id="cb7-18"><a href="#cb7-18"></a><span class="st">-     borrowed_iterator_t&lt;R&gt; uninitialized_fill(R&amp;&amp; r, const T&amp; x);</span></span>
<span id="cb7-19"><a href="#cb7-19"></a><span class="va">+     constexpr borrowed_iterator_t&lt;R&gt; uninitialized_fill(R&amp;&amp; r, const T&amp; x);</span></span>
<span id="cb7-20"><a href="#cb7-20"></a>  }</span>
<span id="cb7-21"><a href="#cb7-21"></a></span>
<span id="cb7-22"><a href="#cb7-22"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb7-23"><a href="#cb7-23"></a>    for (; first != last; ++first)</span>
<span id="cb7-24"><a href="#cb7-24"></a><span class="st">-     ::new (voidify(*first)) remove_reference_t&lt;iter_reference_t&lt;I&gt;&gt;(x);</span></span>
<span id="cb7-25"><a href="#cb7-25"></a><span class="va">+     construct_at(to_address(first), x);</span></span>
<span id="cb7-26"><a href="#cb7-26"></a>    return first;</span>
<span id="cb7-27"><a href="#cb7-27"></a></span>
<span id="cb7-28"><a href="#cb7-28"></a>  template&lt;class NoThrowForwardIterator, class Size, class T&gt;</span>
<span id="cb7-29"><a href="#cb7-29"></a><span class="st">-   NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first, Size n, const T&amp; x);</span></span>
<span id="cb7-30"><a href="#cb7-30"></a><span class="va">+   constexpr NoThrowForwardIterator uninitialized_fill_n(NoThrowForwardIterator first,</span></span>
<span id="cb7-31"><a href="#cb7-31"></a><span class="va">+                                                         Size n, const T&amp; x);</span></span>
<span id="cb7-32"><a href="#cb7-32"></a></span>
<span id="cb7-33"><a href="#cb7-33"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb7-34"><a href="#cb7-34"></a>    for (; n--; ++first)</span>
<span id="cb7-35"><a href="#cb7-35"></a><span class="st">-     ::new (voidify(*first))</span></span>
<span id="cb7-36"><a href="#cb7-36"></a><span class="st">-       typename iterator_traits&lt;NoThrowForwardIterator&gt;::value_type(x);</span></span>
<span id="cb7-37"><a href="#cb7-37"></a><span class="va">+     construct_at(to_address(first), x);</span></span>
<span id="cb7-38"><a href="#cb7-38"></a>    return first;</span>
<span id="cb7-39"><a href="#cb7-39"></a></span>
<span id="cb7-40"><a href="#cb7-40"></a>  namespace ranges {</span>
<span id="cb7-41"><a href="#cb7-41"></a>    template&lt;no-throw-forward-iterator I, class T&gt;</span>
<span id="cb7-42"><a href="#cb7-42"></a>      requires constructible_from&lt;iter_value_t&lt;I&gt;, const T&amp;&gt;</span>
<span id="cb7-43"><a href="#cb7-43"></a><span class="st">-     I uninitialized_fill_n(I first, iter_difference_t&lt;I&gt; n, const T&amp; x);</span></span>
<span id="cb7-44"><a href="#cb7-44"></a><span class="va">+     constexpr I uninitialized_fill_n(I first, iter_difference_t&lt;I&gt; n, const T&amp; x);</span></span>
<span id="cb7-45"><a href="#cb7-45"></a>  }</span>
<span id="cb7-46"><a href="#cb7-46"></a></span>
<span id="cb7-47"><a href="#cb7-47"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb7-48"><a href="#cb7-48"></a>    return uninitialized_fill(counted_iterator(first, n), default_sentinel, x).base();</span></code></pre></div>
</div>
<h2 data-number="4.8" id="add-25.11.8-special.default_construct-to-n4762"><span class="header-section-number">4.8</span> Add <strong>25.11.8 [special.default_construct]</strong> to <span class="citation" data-cites="N4762">[<a href="#ref-N4762" role="doc-biblioref">N4762</a>]</span><a href="#add-25.11.8-special.default_construct-to-n4762" class="self-link"></a></h2>
<div class="add" style="color: #006e28">

<div class="sourceCode" id="cb8"><pre class="sourceCode default default"><code class="sourceCode default"><span id="cb8-1"><a href="#cb8-1"></a>  template&lt;class T&gt;</span>
<span id="cb8-2"><a href="#cb8-2"></a>    constexpr T* default_construct_at(T* location);</span>
<span id="cb8-3"><a href="#cb8-3"></a> </span>
<span id="cb8-4"><a href="#cb8-4"></a>  namespace ranges {</span>
<span id="cb8-5"><a href="#cb8-5"></a>    template&lt;class T&gt;</span>
<span id="cb8-6"><a href="#cb8-6"></a>      constexpr T* default_construct_at(T* location);</span>
<span id="cb8-7"><a href="#cb8-7"></a>  }</span>
<span id="cb8-8"><a href="#cb8-8"></a> </span>
<span id="cb8-9"><a href="#cb8-9"></a>  <em>Constraints:</em> </span>
<span id="cb8-10"><a href="#cb8-10"></a>    The expression ::new (declval&lt;void*&gt;()) T is well-formed when treated as an unevaluated operand.</span>
<span id="cb8-11"><a href="#cb8-11"></a> </span>
<span id="cb8-12"><a href="#cb8-12"></a>  <em>Effects:</em> Equivalent to:</span>
<span id="cb8-13"><a href="#cb8-13"></a>    return ::new (voidify(*location)) T;</span></code></pre></div>

</div>
<h1 data-number="5" id="implementation-experience"><span class="header-section-number">5</span> Implementation Experience<a href="#implementation-experience" class="self-link"></a></h1>
<ul>
<li><a href="https://https://github.com/microsoft/STL"><code class="sourceCode default">Microsoft STL</code></a> This has been partially implemented for support of constexpr vector in MSVC STL.</li>
</ul>
<h1 data-number="6" id="bibliography"><span class="header-section-number">6</span> References<a href="#bibliography" class="self-link"></a></h1>
<div id="refs" class="references hanging-indent" role="doc-bibliography">
<div id="ref-N4762">
<p>[N4762] Richard Smith. 2018-07-07. Working Draft, Standard for Programming Language C++. <br />
<a href="https://wg21.link/n4762">https://wg21.link/n4762</a></p>
</div>
<div id="ref-P0784R7">
<p>[P0784R7] 2019. More constexpr containers. <br />
<a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0784r7.html</a></p>
</div>
</div>
</div>
</div>
</body>
</html>
