<!DOCTYPE html><html lang='en'><head><title>[dcl.fct.def]</title><meta charset='UTF-8'/><link rel='stylesheet' type='text/css' href='14882.css'/><link rel='stylesheet' type='text/css' href='expanded.css' title='Notes and examples expanded'/><link rel='alternate stylesheet' type='text/css' href='colored.css' title='Notes and examples colored'/><link rel='alternate stylesheet' type='text/css' href='collapsed.css' title='Notes and examples collapsed'/><link rel='icon' href='icon.png'/></head><body><div class='wrapper'><h1 ><a class='secnum' style='min-width:73pt'>9</a> Declarations <a class='abbr_ref' href='./#dcl.dcl'>[dcl.dcl]</a></h1><h2 ><a class='secnum' style='min-width:88pt'>9.4</a> Function definitions <a class='abbr_ref'>[dcl.fct.def]</a></h2><span class='indexparent'><a class='index' id=':definition,function'></a></span><div id='general' class='section'><h3 ><a class='secnum' href='#general' style='min-width:103pt'>9.4.1</a> In general <a class='abbr_ref' href='dcl.fct.def.general'>[dcl.fct.def.general]</a></h3><div class='para' id='general-1'><div class='marginalizedparent'><a class='marginalized' href='#general-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5680'>#</a></div><div id='general-1.sentence-1' class='sentence'><span class='indexparent'><a class='index' id=':body,function'></a></span>Function definitions have the form
<span class='indexparent'><a class='index' id=':function-definition'></a></span><pre class='bnf'><a class='nontermdef' href='#nt:function-definition' id='nt:function-definition'>function-definition:</a>
&#9;<i ><a href='dcl.attr.grammar#nt:attribute-specifier-seq'>attribute-specifier-seq</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='dcl.spec#nt:decl-specifier-seq'>decl-specifier-seq</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='dcl.decl#nt:declarator'>declarator</a></i> <i ><a href='class.mem#nt:virt-specifier-seq'>virt-specifier-seq</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='#nt:function-body'>function-body</a></i>
&#9;<i ><a href='dcl.attr.grammar#nt:attribute-specifier-seq'>attribute-specifier-seq</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='dcl.spec#nt:decl-specifier-seq'>decl-specifier-seq</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='dcl.decl#nt:declarator'>declarator</a></i> <i ><a href='temp#nt:requires-clause'>requires-clause</a></i> <i ><a href='#nt:function-body'>function-body</a></i>
</pre></div><pre class='bnf'><a class='nontermdef' href='#nt:function-body' id='nt:function-body'>function-body:</a>
&#9;<i ><a href='class.base.init#nt:ctor-initializer'>ctor-initializer</a></i><span class="mjx-chtml"><span class="mjx-math" aria-label="_\mathit{opt}"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-texatom"><span class="mjx-mrow"><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.298em;">o</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.225em; padding-bottom: 0.446em;">p</span></span><span class="mjx-mi"><span class="mjx-char MJXc-TeX-main-I" style="padding-top: 0.372em; padding-bottom: 0.298em;">t</span></span></span></span></span></span></span></span></span> <i ><a href='stmt.block#nt:compound-statement'>compound-statement</a></i>
&#9;<i ><a href='except#nt:function-try-block'>function-try-block</a></i>
&#9;<span class='terminal'><span class='operator'>=</span> <span class='keyword'>default</span> ;</span>
&#9;<span class='terminal'><span class='operator'>=</span> <span class='keyword'>delete</span> ;</span>
</pre><div id='general-1.sentence-2' class='sentence'>Any informal reference to the body of a function should be interpreted as a reference to
the non-terminal <i ><a href='#nt:function-body'>function-body</a></i><a class='hidden_link' href='#general-1.sentence-2'>.</a></div> <div id='general-1.sentence-3' class='sentence'>The optional <i ><a href='dcl.attr.grammar#nt:attribute-specifier-seq'>attribute-specifier-seq</a></i> in a <i ><a href='#nt:function-definition'>function-definition</a></i>
appertains to the function<a class='hidden_link' href='#general-1.sentence-3'>.</a></div> <div id='general-1.sentence-4' class='sentence'>A <i ><a href='class.mem#nt:virt-specifier-seq'>virt-specifier-seq</a></i> can be part of a <i ><a href='#nt:function-definition'>function-definition</a></i>
only if it is a <i ><a href='class.mem#nt:member-declaration'>member-declaration</a></i> (<a href='class.mem'>[class.mem]</a>)<a class='hidden_link' href='#general-1.sentence-4'>.</a></div></div><div class='para' id='general-2'><div class='marginalizedparent'><a class='marginalized' href='#general-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5706'>#</a></div><div id='general-2.sentence-1' class='sentence'>In a <i ><a href='#nt:function-definition'>function-definition</a></i>,
either <span class='texttt'><span class='keyword'>void</span></span> <i ><a href='dcl.decl#nt:declarator'>declarator</a></i> <span class='texttt'>;</span>
or <i ><a href='dcl.decl#nt:declarator'>declarator</a></i> <span class='texttt'>;</span>
shall be a well-formed function declaration
as described in <a href='dcl.fct'>[dcl.fct]</a><a class='hidden_link' href='#general-2.sentence-1'>.</a></div> <div id='general-2.sentence-2' class='sentence'>A function shall be defined only in namespace or class scope<a class='hidden_link' href='#general-2.sentence-2'>.</a></div> <div id='general-2.sentence-3' class='sentence'>The type of a parameter or the return type for a function
definition shall not be
an incomplete or abstract (possibly cv-qualified) class type
in the context of the function definition
unless the function is deleted (<a href='#delete'>[dcl.fct.def.delete]</a>)<a class='hidden_link' href='#general-2.sentence-3'>.</a></div></div><div class='para' id='general-3'><div class='marginalizedparent'><a class='marginalized' href='#general-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5719'>#</a></div><div id='general-3.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#general-3.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='general-3.sentence-1' class='sentence'>A simple example of a complete function definition is</div><pre class='codeblock'>
<span class='keyword'>int</span> max<span class='parenthesis'>(</span><span class='keyword'>int</span> a, <span class='keyword'>int</span> b, <span class='keyword'>int</span> c<span class='parenthesis'>)</span> <span class='curlybracket'>{</span>
  <span class='keyword'>int</span> m <span class='operator'>=</span> <span class='parenthesis'>(</span>a <span class='anglebracket'>&gt;</span> b<span class='parenthesis'>)</span> <span class='operator'>?</span> a <span class='operator'>:</span> b;
  <span class='keyword'>return</span> <span class='parenthesis'>(</span>m <span class='anglebracket'>&gt;</span> c<span class='parenthesis'>)</span> <span class='operator'>?</span> m <span class='operator'>:</span> c;
<span class='curlybracket'>}</span>
</pre><div id='general-3.sentence-2' class='sentence'>Here
<span class='texttt'><span class='keyword'>int</span></span>
is the
<i ><a href='dcl.spec#nt:decl-specifier-seq'>decl-specifier-seq</a></i>;
<span class='texttt'>max<span class='parenthesis'>(</span><span class='keyword'>int</span></span>
<span class='texttt'>a,</span>
<span class='texttt'><span class='keyword'>int</span></span>
<span class='texttt'>b,</span>
<span class='texttt'><span class='keyword'>int</span></span>
<span class='texttt'>c<span class='parenthesis'>)</span></span>
is the
<i ><a href='dcl.decl#nt:declarator'>declarator</a></i>;
<span class='texttt'><span class='curlybracket'>{</span> <span class='comment'>/* ... */</span> <span class='curlybracket'>}</span></span>
is the
<i ><a href='#nt:function-body'>function-body</a></i><a class='hidden_link' href='#general-3.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='general-4'><div class='marginalizedparent'><a class='marginalized' href='#general-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5747'>#</a></div><div id='general-4.sentence-1' class='sentence'><span class='indexparent'><a class='index' id=':initializer,base_class'></a></span><span class='indexparent'><a class='index' id=':initializer,member'></a></span><span class='indexparent'><a class='index' id=':definition,constructor'></a></span>A
<i ><a href='class.base.init#nt:ctor-initializer'>ctor-initializer</a></i>
is used only in a constructor; see <a href='class.ctor'>[class.ctor]</a> and <a href='class.init'>[class.init]</a><a class='hidden_link' href='#general-4.sentence-1'>.</a></div></div><div class='para' id='general-5'><div class='marginalizedparent'><a class='marginalized' href='#general-5'>5</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5755'>#</a></div><div id='general-5.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#general-5.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='general-5.sentence-1' class='sentence'>A <i ><a href='dcl.decl#nt:cv-qualifier-seq'>cv-qualifier-seq</a></i> affects the type of <span class='texttt'><span class='keyword'>this</span></span>
in the body of a member function; see <a href='dcl.ref'>[dcl.ref]</a><a class='hidden_link' href='#general-5.sentence-1'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='general-6'><div class='marginalizedparent'><a class='marginalized' href='#general-6'>6</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5761'>#</a></div><div id='general-6.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#general-6.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='general-6.sentence-1' class='sentence'>Unused parameters need not be named<a class='hidden_link' href='#general-6.sentence-1'>.</a></div> <div id='general-6.sentence-2' class='sentence'>For example,</div><pre class='codeblock'>
<span class='keyword'>void</span> print<span class='parenthesis'>(</span><span class='keyword'>int</span> a, <span class='keyword'>int</span><span class='parenthesis'>)</span> <span class='curlybracket'>{</span>
  std<span class='operator'>:</span><span class='operator'>:</span>printf<span class='parenthesis'>(</span><span class='literal'>"a = %d\n"</span>,a<span class='parenthesis'>)</span>;
<span class='curlybracket'>}</span>
</pre> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='general-7'><div class='marginalizedparent'><a class='marginalized' href='#general-7'>7</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5773'>#</a></div><div id='general-7.sentence-1' class='sentence'>In the <i ><a href='#nt:function-body'>function-body</a></i>, a
<a class='hidden_link' href='#def:variable,function-local_predefined' id='def:variable,function-local_predefined'><i >function-local predefined variable</i></a> denotes a block-scope object of static
storage duration that is implicitly defined (see <a href='basic.scope.block'>[basic.scope.block]</a>)<a class='hidden_link' href='#general-7.sentence-1'>.</a></div></div><div class='para' id='general-8'><div class='marginalizedparent'><a class='marginalized' href='#general-8'>8</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5778'>#</a></div><div id='general-8.sentence-1' class='sentence'>The function-local predefined variable <span class='texttt'>__func__</span> is
defined as if a definition of the form
<pre class='codeblock'>
<span class='keyword'>static</span> <span class='keyword'>const</span> <span class='keyword'>char</span> __func__<span class='squarebracket'>[</span><span class='squarebracket'>]</span> <span class='operator'>=</span> <span class='literal'>"<span class='textit'>function-name</span>"</span>;
</pre>
had been provided, where <span class='texttt'><span class='textit'>function-name</span></span> is an <span class='indexparent'><a class='index' id=':string_resulting_from___func__'></a></span>implementation-defined string<a class='hidden_link' href='#general-8.sentence-1'>.</a></div> <div id='general-8.sentence-2' class='sentence'>It is unspecified whether such a variable has an address
distinct from that of any other object in the program<a class='hidden_link' href='#general-8.sentence-2'>.</a><a class='footnotenum' href='#footnote-99'>99</a></div> <div id='general-8.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#general-8.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
<span class='keyword'>struct</span> S <span class='curlybracket'>{</span>
  S<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>:</span> s<span class='parenthesis'>(</span>__func__<span class='parenthesis'>)</span> <span class='curlybracket'>{</span> <span class='curlybracket'>}</span>             <span class='comment'>// OK</span>
  <span class='keyword'>const</span> <span class='keyword'>char</span><span class='operator'>*</span> s;
<span class='curlybracket'>}</span>;
<span class='keyword'>void</span> f<span class='parenthesis'>(</span><span class='keyword'>const</span> <span class='keyword'>char</span><span class='operator'>*</span> s <span class='operator'>=</span> __func__<span class='parenthesis'>)</span>;   <span class='comment'>// error: <span class='tcode_in_codeblock'>__func__</span> is undeclared</span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='footnote' id='footnote-99'><div class='footnoteNumberParent'><a class='marginalized' href='#footnote-99'>99)</a></div><div id='footnote-99.sentence-1' class='sentence'>Implementations are
permitted to provide additional predefined variables with names that are reserved to the
implementation (<a href='lex.name'>[lex.name]</a>)<a class='hidden_link' href='#footnote-99.sentence-1'>.</a></div> <div id='footnote-99.sentence-2' class='sentence'>If a predefined variable is not
odr-used (<a href='basic.def.odr'>[basic.def.odr]</a>), its string value need not be present in the program image<a class='hidden_link' href='#footnote-99.sentence-2'>.</a></div></div></div><div id='default' class='section'><h3 ><a class='secnum' href='#default' style='min-width:103pt'>9.4.2</a> Explicitly-defaulted functions <a class='abbr_ref' href='dcl.fct.def.default'>[dcl.fct.def.default]</a></h3><div class='para' id='default-1'><div class='marginalizedparent'><a class='marginalized' href='#default-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5803'>#</a></div><div id='default-1.sentence-1' class='sentence'>A function definition whose
<i ><a href='#nt:function-body'>function-body</a></i>
is of the form
<span class='texttt'><span class='operator'>=</span> <span class='keyword'>default</span> ;</span>
is called an <a class='hidden_link' href='#def:definition,function,explicitly-defaulted' id='def:definition,function,explicitly-defaulted'><i >explicitly-defaulted</i></a> definition<a class='hidden_link' href='#default-1.sentence-1'>.</a></div> <div id='default-1.sentence-2' class='sentence'>A function that is explicitly defaulted shall</div><div id='default-1.sentence-3' class='sentence'><ul class='itemize'><li id='default-1.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-1.1'>(1.1)</a></div><div id='default-1.1.sentence-1' class='sentence'>be a special member function or a comparison operator
(<a href='expr.spaceship'>[expr.spaceship]</a>, <a href='expr.rel'>[expr.rel]</a>, <a href='expr.eq'>[expr.eq]</a>), and</div></li><li id='default-1.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-1.2'>(1.2)</a></div><div id='default-1.2.sentence-1' class='sentence'>not have default arguments<a class='hidden_link' href='#default-1.2.sentence-1'>.</a></div></li></ul></div></div><div class='para' id='default-2'><div class='marginalizedparent'><a class='marginalized' href='#default-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5819'>#</a></div><div id='default-2.sentence-1' class='sentence'>The type <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_1"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span></span></span></span></span></span> of an explicitly defaulted function <span class='texttt'>F</span>
is allowed to differ from the type <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_2"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span></span></span></span></span> it would have had
if it were implicitly declared, as follows:
<ul class='itemize'><li id='default-2.1'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-2.1'>(2.1)</a></div><div id='default-2.1.sentence-1' class='sentence'><span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_1"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span></span></span></span></span></span> and <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_2"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span></span></span></span></span> may have differing <i ><a href='dcl.decl#nt:ref-qualifier'>ref-qualifier</a></i><span class='textit'>s</span>; and</div></li><li id='default-2.2'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-2.2'>(2.2)</a></div><div id='default-2.2.sentence-1' class='sentence'>if <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_2"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span></span></span></span></span> has a parameter of type <span class='texttt'><span class='keyword'>const</span> C<span class='operator'>&amp;</span></span>,
  the corresponding parameter of <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_1"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span></span></span></span></span></span> may be of type <span class='texttt'>C<span class='operator'>&amp;</span></span><a class='hidden_link' href='#default-2.2.sentence-1'>.</a></div></li></ul></div> <div id='default-2.sentence-2' class='sentence'>
If <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_1"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span></span></span></span></span></span> differs from <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_2"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span></span></span></span></span> in any other way, then:
<ul class='itemize'><li id='default-2.3'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-2.3'>(2.3)</a></div><div id='default-2.3.sentence-1' class='sentence'>if <span class='texttt'>F</span> is an assignment operator, and
  the return type of <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_1"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span></span></span></span></span></span> differs from
  the return type of <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_2"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">2</span></span></span></span></span></span></span> or
  <span class='texttt'>T</span><span class="mjx-chtml"><span class="mjx-math" aria-label="_1"><span class="mjx-mrow" aria-hidden="true"><span class="mjx-msubsup"><span class="mjx-base"><span class="mjx-mi"><span class="mjx-char"></span></span></span><span class="mjx-sub" style="font-size: 70.7%; vertical-align: -0.212em; padding-right: 0.071em;"><span class="mjx-mn"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.372em; padding-bottom: 0.372em;">1</span></span></span></span></span></span></span>'s parameter type is not a reference,
  the program is ill-formed;</div></li><li id='default-2.4'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-2.4'>(2.4)</a></div><div id='default-2.4.sentence-1' class='sentence'>otherwise, if <span class='texttt'>F</span> is explicitly defaulted on its first declaration,
  it is defined as deleted;</div></li><li id='default-2.5'><div class='marginalizedparent' style='left:-7em'><a class='marginalized' href='#default-2.5'>(2.5)</a></div><div id='default-2.5.sentence-1' class='sentence'>otherwise, the program is ill-formed<a class='hidden_link' href='#default-2.5.sentence-1'>.</a></div></li></ul></div></div><div class='para' id='default-3'><div class='marginalizedparent'><a class='marginalized' href='#default-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5845'>#</a></div><div id='default-3.sentence-1' class='sentence'>An explicitly-defaulted function that is not defined as deleted may be declared
<span class='texttt'><span class='keyword'>constexpr</span></span> or <span class='texttt'><span class='keyword'>consteval</span></span> only
if it would have been implicitly declared as <span class='texttt'><span class='keyword'>constexpr</span></span><a class='hidden_link' href='#default-3.sentence-1'>.</a></div> <div id='default-3.sentence-2' class='sentence'>If a function is explicitly defaulted on its first declaration,
it is implicitly considered to be <span class='texttt'><span class='keyword'>constexpr</span></span> if the implicit
declaration would be<a class='hidden_link' href='#default-3.sentence-2'>.</a></div></div><div class='para' id='default-4'><div class='marginalizedparent'><a class='marginalized' href='#default-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5853'>#</a></div><div id='default-4.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#default-4.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
<span class='keyword'>struct</span> S <span class='curlybracket'>{</span>
  <span class='keyword'>constexpr</span> S<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;              <span class='comment'>// ill-formed: implicit <span class='tcode_in_codeblock'>S()</span> is not <span class='tcode_in_codeblock'>constexpr</span></span>
  S<span class='parenthesis'>(</span><span class='keyword'>int</span> a <span class='operator'>=</span> <span class='literal'>0</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;               <span class='comment'>// ill-formed: default argument</span>
  <span class='keyword'>void</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> S<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;   <span class='comment'>// ill-formed: non-matching return type</span>
  <span class='operator'>~</span>S<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='keyword'>noexcept</span><span class='parenthesis'>(</span><span class='literal'>false</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;       <span class='comment'>// deleted: exception specification does not match</span>
<span class='keyword'>private</span><span class='operator'>:</span>
  <span class='keyword'>int</span> i;
  S<span class='parenthesis'>(</span>S<span class='operator'>&amp;</span><span class='parenthesis'>)</span>;                                <span class='comment'>// OK: private copy constructor</span>
<span class='curlybracket'>}</span>;
S<span class='operator'>:</span><span class='operator'>:</span>S<span class='parenthesis'>(</span>S<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;                     <span class='comment'>// OK: defines copy constructor</span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='default-5'><div class='marginalizedparent'><a class='marginalized' href='#default-5'>5</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5869'>#</a></div><div id='default-5.sentence-1' class='sentence'>Explicitly-defaulted functions and implicitly-declared functions are collectively
called <a class='hidden_link' href='#def:defaulted' id='def:defaulted'><i >defaulted</i></a> functions, and the implementation
shall provide implicit definitions
for them (<a href='class.ctor'>[class.ctor]</a>
<a href='class.dtor'>[class.dtor]</a>, <a href='class.copy.ctor'>[class.copy.ctor]</a>, <a href='class.copy.assign'>[class.copy.assign]</a>),
which might mean defining them as deleted<a class='hidden_link' href='#default-5.sentence-1'>.</a></div> <div id='default-5.sentence-2' class='sentence'>A function is
<a class='hidden_link' href='#def:user-provided' id='def:user-provided'><i >user-provided</i></a> if it is user-declared and not explicitly
defaulted or deleted on its first declaration<a class='hidden_link' href='#default-5.sentence-2'>.</a></div> <div id='default-5.sentence-3' class='sentence'>A user-provided explicitly-defaulted function
(i.e., explicitly defaulted after its first declaration)
is defined at the point where it is explicitly defaulted; if such a function is implicitly
defined as deleted, the program is ill-formed<a class='hidden_link' href='#default-5.sentence-3'>.</a></div> <div id='default-5.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#default-5.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='default-5.sentence-4' class='sentence'>Declaring a function as defaulted after its first declaration can provide
efficient execution and concise
definition while enabling a stable binary interface to an evolving code
base<a class='hidden_link' href='#default-5.sentence-4'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='default-6'><div class='marginalizedparent'><a class='marginalized' href='#default-6'>6</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5888'>#</a></div><div id='default-6.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#default-6.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
<span class='keyword'>struct</span> trivial <span class='curlybracket'>{</span>
  trivial<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  trivial<span class='parenthesis'>(</span><span class='keyword'>const</span> trivial<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  trivial<span class='parenthesis'>(</span>trivial<span class='operator'>&amp;</span><span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  trivial<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> trivial<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  trivial<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>trivial<span class='operator'>&amp;</span><span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  <span class='operator'>~</span>trivial<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
<span class='curlybracket'>}</span>;

<span class='keyword'>struct</span> nontrivial1 <span class='curlybracket'>{</span>
  nontrivial1<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
<span class='curlybracket'>}</span>;
nontrivial1<span class='operator'>:</span><span class='operator'>:</span>nontrivial1<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;   <span class='comment'>// not first declaration</span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div></div><div id='delete' class='section'><h3 ><a class='secnum' href='#delete' style='min-width:103pt'>9.4.3</a> Deleted definitions <a class='abbr_ref' href='dcl.fct.def.delete'>[dcl.fct.def.delete]</a></h3><span class='indexparent'><a class='index' id=':definition,function,deleted'></a></span><div class='para' id='delete-1'><div class='marginalizedparent'><a class='marginalized' href='#delete-1'>1</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5910'>#</a></div><div id='delete-1.sentence-1' class='sentence'>A function definition whose
<i ><a href='#nt:function-body'>function-body</a></i>
is of the form
<span class='texttt'><span class='operator'>=</span> <span class='keyword'>delete</span> ;</span>
is called a <a class='hidden_link' href='#def:deleted_definition' id='def:deleted_definition'><i>deleted definition</i></a><a class='hidden_link' href='#delete-1.sentence-1'>.</a></div> <div id='delete-1.sentence-2' class='sentence'>A function with a
deleted definition is also called a <a class='hidden_link' href='#def:deleted_function' id='def:deleted_function'><i>deleted function</i></a><a class='hidden_link' href='#delete-1.sentence-2'>.</a></div></div><div class='para' id='delete-2'><div class='marginalizedparent'><a class='marginalized' href='#delete-2'>2</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5918'>#</a></div><div id='delete-2.sentence-1' class='sentence'>A program that refers to a deleted function implicitly or explicitly, other
than to declare it, is ill-formed<a class='hidden_link' href='#delete-2.sentence-1'>.</a></div> <div id='delete-2.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#delete-2.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='delete-2.sentence-2' class='sentence'>This includes calling the function
implicitly or explicitly and forming a pointer or pointer-to-member to the
function<a class='hidden_link' href='#delete-2.sentence-2'>.</a></div> <div id='delete-2.sentence-3' class='sentence'>It applies even for references in expressions that are not
potentially-evaluated<a class='hidden_link' href='#delete-2.sentence-3'>.</a></div> <div id='delete-2.sentence-4' class='sentence'>If a function is overloaded, it is referenced only if the
function is selected by overload resolution<a class='hidden_link' href='#delete-2.sentence-4'>.</a></div> <div id='delete-2.sentence-5' class='sentence'>The implicit
odr-use (<a href='basic.def.odr'>[basic.def.odr]</a>) of a virtual function does not, by itself,
constitute a reference<a class='hidden_link' href='#delete-2.sentence-5'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='delete-3'><div class='marginalizedparent'><a class='marginalized' href='#delete-3'>3</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5928'>#</a></div><div id='delete-3.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#delete-3.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='delete-3.sentence-1' class='sentence'>One can prevent default initialization and
initialization by non-<span class='texttt'><span class='keyword'>double</span></span>s with
<pre class='codeblock'>
<span class='keyword'>struct</span> onlydouble <span class='curlybracket'>{</span>
  onlydouble<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;                <span class='comment'>// OK, but redundant</span>
  <span class='keyword'>template</span><span class='anglebracket'>&lt;</span><span class='keyword'>class</span> T<span class='anglebracket'>&gt;</span>
    onlydouble<span class='parenthesis'>(</span>T<span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;
  onlydouble<span class='parenthesis'>(</span><span class='keyword'>double</span><span class='parenthesis'>)</span>;
<span class='curlybracket'>}</span>;
</pre></div> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> <div id='delete-3.example-2' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#delete-3.example-2'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='delete-3.sentence-2' class='sentence'>One can prevent use of a
class in certain <i ><a href='expr.new#nt:new-expression'>new-expression</a></i><span class='textit'>s</span> by using deleted definitions
of a user-declared <span class='texttt'><span class='keyword'>operator</span> <span class='keyword'>new</span></span> for that class<a class='hidden_link' href='#delete-3.sentence-2'>.</a></div> <pre class='codeblock'>
<span class='keyword'>struct</span> sometype <span class='curlybracket'>{</span>
  <span class='keyword'>void</span><span class='operator'>*</span> <span class='keyword'>operator</span> <span class='keyword'>new</span><span class='parenthesis'>(</span>std<span class='operator'>:</span><span class='operator'>:</span>size_t<span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;
  <span class='keyword'>void</span><span class='operator'>*</span> <span class='keyword'>operator</span> <span class='keyword'>new</span><span class='squarebracket'>[</span><span class='squarebracket'>]</span><span class='parenthesis'>(</span>std<span class='operator'>:</span><span class='operator'>:</span>size_t<span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;
<span class='curlybracket'>}</span>;
sometype<span class='operator'>*</span> p <span class='operator'>=</span> <span class='keyword'>new</span> sometype;     <span class='comment'>// error, deleted class <span class='tcode_in_codeblock'>operator new</span></span>
sometype<span class='operator'>*</span> q <span class='operator'>=</span> <span class='keyword'>new</span> sometype<span class='squarebracket'>[</span><span class='literal'>3</span><span class='squarebracket'>]</span>;  <span class='comment'>// error, deleted class <span class='tcode_in_codeblock'>operator new[]</span></span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> <div id='delete-3.example-3' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#delete-3.example-3'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <div id='delete-3.sentence-3' class='sentence'>One can make a class uncopyable, i.e., move-only, by using deleted
definitions of the copy constructor and copy assignment operator, and then
providing defaulted definitions of the move constructor and move assignment operator<a class='hidden_link' href='#delete-3.sentence-3'>.</a></div> <pre class='codeblock'>
<span class='keyword'>struct</span> moveonly <span class='curlybracket'>{</span>
  moveonly<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  moveonly<span class='parenthesis'>(</span><span class='keyword'>const</span> moveonly<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;
  moveonly<span class='parenthesis'>(</span>moveonly<span class='operator'>&amp;</span><span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  moveonly<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span><span class='keyword'>const</span> moveonly<span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;
  moveonly<span class='operator'>&amp;</span> <span class='keyword'>operator</span><span class='operator'>=</span><span class='parenthesis'>(</span>moveonly<span class='operator'>&amp;</span><span class='operator'>&amp;</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
  <span class='operator'>~</span>moveonly<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>default</span>;
<span class='curlybracket'>}</span>;
moveonly<span class='operator'>*</span> p;
moveonly q<span class='parenthesis'>(</span><span class='operator'>*</span>p<span class='parenthesis'>)</span>;                 <span class='comment'>// error, deleted copy constructor</span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div> </div><div class='para' id='delete-4'><div class='marginalizedparent'><a class='marginalized' href='#delete-4'>4</a></div><div class='sourceLinkParent'><a class='sourceLink' href='https://github.com/Eelis/draft73ca144c7e48612fe72742f9f6a5ec9ad6a934d2/source/declarations.tex#L5973'>#</a></div><div id='delete-4.sentence-1' class='sentence'>A deleted function is implicitly an inline function (<a href='dcl.inline'>[dcl.inline]</a>)<a class='hidden_link' href='#delete-4.sentence-1'>.</a></div> <div id='delete-4.note-1' class='note'>[<span style='white-space:nowrap'> </span><a class='note_link' href='#delete-4.note-1'><span class='textit'>Note</span></a><div class='noteBody'><span class='textit'>:</span> <div id='delete-4.sentence-2' class='sentence'>The
one-definition rule (<a href='basic.def.odr'>[basic.def.odr]</a>) applies to deleted definitions<a class='hidden_link' href='#delete-4.sentence-2'>.</a></div> —<span style='white-space:nowrap'> </span><i>end note</i></div><span style='white-space:nowrap'> </span>]</div>  <div id='delete-4.sentence-3' class='sentence'>
A deleted definition of a function shall be the first declaration of the function or,
for an explicit specialization of a function template, the first declaration of that
specialization<a class='hidden_link' href='#delete-4.sentence-3'>.</a></div> <div id='delete-4.sentence-4' class='sentence'>An implicitly declared allocation or deallocation function (<a href='basic.stc.dynamic'>[basic.stc.dynamic]</a>)
shall not be defined as deleted<a class='hidden_link' href='#delete-4.sentence-4'>.</a></div> <div id='delete-4.example-1' class='example'>[<span style='white-space:nowrap'> </span><a class='example_link' href='#delete-4.example-1'><span class='textit'>Example</span></a><div class='exampleBody'><span class='textit'>:</span> <pre class='codeblock'>
<span class='keyword'>struct</span> sometype <span class='curlybracket'>{</span>
  sometype<span class='parenthesis'>(</span><span class='parenthesis'>)</span>;
<span class='curlybracket'>}</span>;
sometype<span class='operator'>:</span><span class='operator'>:</span>sometype<span class='parenthesis'>(</span><span class='parenthesis'>)</span> <span class='operator'>=</span> <span class='keyword'>delete</span>;  <span class='comment'>// ill-formed; not first declaration</span>
</pre> —<span style='white-space:nowrap'> </span><i>end example</i></div><span style='white-space:nowrap'> </span>]</div>  </div></div></div></body></html>