<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3028: Container requirements tables should distinguish const and non-const variables</title>
<meta property="og:title" content="Issue 3028: Container requirements tables should distinguish const and non-const variables">
<meta property="og:description" content="C++ library issue. Status: C++23">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3028.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++23">C++23</a> status.</em></p>
<h3 id="3028"><a href="lwg-defects.html#3028">3028</a>. Container requirements tables should distinguish <code>const</code> and non-<code>const</code> variables</h3>
<p><b>Section:</b> 23.2.2 <a href="https://wg21.link/container.requirements.general">[container.requirements.general]</a> <b>Status:</b> <a href="lwg-active.html#C++23">C++23</a>
 <b>Submitter:</b> Jonathan Wakely <b>Opened:</b> 2017-10-17 <b>Last modified:</b> 2023-11-22</p>
<p><b>Priority: </b>3
</p>
<p><b>View other</b> <a href="lwg-index-open.html#container.requirements.general">active issues</a> in [container.requirements.general].</p>
<p><b>View all other</b> <a href="lwg-index.html#container.requirements.general">issues</a> in [container.requirements.general].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++23">C++23</a> status.</p>
<p><b>Discussion:</b></p>
<p>
[container.requirements.general] p4 says:
</p>
<blockquote>
<p>
In Tables 83, 84, and 85 <code>X</code> denotes a container class containing
objects of type <code>T</code>, <code>a</code> and <code>b</code> denote values of type <code>X</code>, <code>u</code> denotes an
identifier, <code>r</code> denotes a non-<code>const</code> value of type <code>X</code>, and <code>rv</code> denotes a
non-<code>const</code> rvalue of type <code>X</code>.
</p>
</blockquote>
<p>
This doesn't say anything about whether <code>a</code> and <code>b</code> are allowed to be
<code>const</code>, or must be non-<code>const</code>. In fact Table 83 uses them
inconsistently, e.g. the rows for "<code>a = rv</code>" and "<code>a.swap(b)</code>" most
certainly require them to be non-<code>const</code>, but all other uses are valid
for either <code>const</code> or non-<code>const X</code>.
</p>

<p><i>[2017-11 Albuquerque Wednesday night issues processing]</i></p>

<p>Priority set to 3; Jonathan to provide updated wording.</p>
<p>Wording needs adjustment - could use "possibly const values of type X"</p>
<p>Will distinguish between lvalue/rvalue </p>

<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>This wording is relative to <a href="https://wg21.link/n4687">N4687</a>.</p>

<ol>
<li><p>Change 23.2.2 <a href="https://wg21.link/container.requirements.general">[container.requirements.general]</a> p4 as indicated:</p>

<blockquote>
<p>
-4- In Tables 83, 84, and 85 <code>X</code> denotes a container class containing objects of type <code>T</code>, 
<code>a</code> and <code>b</code> denote values of type <code>X</code>, <code>u</code> denotes an identifier, <code>r</code> 
<ins>and s</ins> denote<del>s a</del> non-<code>const</code> value<ins>s</ins> of type <code>X</code>, and 
<code>rv</code> denotes a non-<code>const</code> rvalue of type <code>X</code>.
</p>
</blockquote>
</li>

<li><p>Change 23.2.2 <a href="https://wg21.link/container.requirements.general">[container.requirements.general]</a>, Table 83 "Container requirements", as indicated:</p>

<blockquote>
<table border="1">
<caption>Table 83 &mdash; Container requirements</caption>
<tr style="text-align:center">
<th>Expression</th>
<th>Return type</th>
<th>Operational<br/>semantics</th>
<th>Assertion/note<br/>pre/post-condition</th>
<th>Complexity</th>
</tr>
<tr>
<td colspan="5" align="center">
<code>[&hellip;]</code>
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>r</ins> = rv</code>
</td>
<td>
<code>X&amp;</code>
</td>
<td>
All existing elements<br/>
of <code><del>a</del><ins>r</ins></code> are either move<br/>
assigned to or<br/>
destroyed
</td>
<td>
<code><del>a</del><ins>r</ins></code> shall be equal to<br/>
the value that <code>rv</code> had<br/>
before this<br/>
assignment
</td>
<td>
linear
</td>
</tr>
<tr>
<td colspan="5" align="center">
<code>[&hellip;]</code>
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>r</ins>.swap(<del>b</del><ins>s</ins>)</code>
</td>
<td>
<code>void</code>
</td>
<td>
</td>
<td>
exchanges the<br/>
contents of <code><del>a</del><ins>r</ins></code> and <code><del>b</del><ins>s</ins></code>
</td>
<td>
(Note A)
</td>
</tr>
<tr>
<td colspan="5" align="center">
<code>[&hellip;]</code>
</td>
</tr>
<tr>
<td>
<code>swap(<del>a</del><ins>r</ins>, <del>b</del><ins>s</ins>)</code>
</td>
<td>
<code>void</code>
</td>
<td>
<code><del>a</del><ins>r</ins>.swap(<del>b</del><ins>s</ins>)</code>
</td>
<td>
</td>
<td>
(Note A)
</td>
</tr>
</table>
</blockquote>
</li>
</ol>
</blockquote>

<p><i>[2020-05-03; Daniel provides alternative wording]</i></p>


<p><strong>Previous resolution [SUPERSEDED]:</strong></p>
<blockquote class="note">
<p>This wording is relative to <a href="https://wg21.link/n4861">N4861</a>.</p>

<ol>
<li><p>Change 23.2.2 <a href="https://wg21.link/container.requirements.general">[container.requirements.general]</a> as indicated:</p>

<blockquote class="note"><p>
[<i>Drafting note:</i>
</p>
<ul>
<li><p>The following presentation also transforms the current list 
into a bullet list as we already have in 23.2.8 <a href="https://wg21.link/unord.req">[unord.req]</a> p11</p></li>
<li><p>It has been decided to replace the symbol <code>r</code> by <code>s</code>, because it is
easy to confuse with <code>rv</code> but means an lvalue instead, and the other container
tables use it rarely and for something completely different (iterator value)</p></li>
<li><p>A separate symbol <code>v</code> is introduced to unambigiously distinguish the
counterpart of a non-<code>const</code> rvalue (See 16.4.4.2 <a href="https://wg21.link/utility.arg.requirements">[utility.arg.requirements]</a>)</p></li>
<li><p>Two separate symbols <code>b</code> and <code>c</code> represent now "(possibly <code>const</code>)
values, while the existing symbol <code>a</code> represents an unspecified value, whose
meaning becomes defined when context is provided, e.g. for overloads like <code>begin()</code>
and <code>end</code></p></li>
</ul>
</blockquote>

<blockquote>
<p>
-4- In Tables 73, 74, and 75<ins>:</ins> 
</p>
<ol style="list-style-type: none">
<li><p>(4.1) &mdash; <code>X</code> denotes a container class containing objects of type <code>T</code>,</p></li>
<li><p>(4.2) &mdash; <code>a</code> <del>and <code>b</code></del> denote<ins>s a</ins> value<del>s</del> of type <code>X</code>,</p></li>
<li><p><ins>(4.2) &mdash; <code>b</code> and <code>c</code> denote (possibly <code>const</code>) values of type <code>X</code>,</ins></p></li>
<li><p>(4.3) &mdash; <code>i</code> and <code>j</code> denote values of type (possibly <code>const</code>) <code>X::iterator</code>,</p></li>
<li><p>(4.4) &mdash; <code>u</code> denotes an identifier,</p></li>
<li><p><ins>(?.?) &mdash; <code>v</code> denotes an lvalue of type (possibly <code>const</code>) <code>X</code> or an
rvalue of type <code>const X</code>,</ins></p></li>
<li><p>(4.5) &mdash; <del><code>r</code></del><ins><code>s</code> and <code>t</code></ins> denote<del>s a</del> non-<code>const</code> 
<del>value</del><ins>lvalues</ins> of type <code>X</code>, and</p></li>
<li><p>(4.6) &mdash; <code>rv</code> denotes a non-<code>const</code> rvalue of type <code>X</code>.</p></li>
</ol>
</blockquote>
</li>

<li><p>Change 23.2.2 <a href="https://wg21.link/container.requirements.general">[container.requirements.general]</a>, Table 73 "Container requirements" [tab:container.req], 
as indicated:</p>

<blockquote class="note"><p>
[<i>Drafting note:</i> The following presentation also moves the copy-assignment expression just before
the move-assignment expression]
</p></blockquote>

<blockquote>
<table border="1">
<caption>Table 73: &mdash; Container requirements [tab:container.req]</caption>
<tr style="text-align:center">
<th>Expression</th>
<th>Return type</th>
<th>Operational<br/>semantics</th>
<th>Assertion/note<br/>pre/post-condition</th>
<th>Complexity</th>
</tr>
<tr>
<td colspan="5" align="center">
<code>[&hellip;]</code>
</td>
</tr>

<tr>
<td>
<code>X(<del>a</del><ins>v</ins>)</code>
</td>
<td>
</td>
<td>
</td>
<td>
<i>Preconditions:</i> <code>T</code> is <i>Cpp17CopyInsertable</i><br/>
into <code>X</code> (see below).<br/>
<i>Postconditions:</i> <code><del>a</del><ins>v</ins> == X(<del>a</del><ins>v</ins>)</code>.
</td>
<td>
linear
</td>
</tr>
<tr>
<td>
<code>X u(<del>a</del><ins>v</ins>);<br/>
X u = <del>a</del><ins>v</ins>;</code>
</td>
<td>
</td>
<td>
</td>
<td>
<i>Preconditions:</i> <code>T</code> is <i>Cpp17CopyInsertable</i><br/>
into <code>X</code> (see below).<br/>
<i>Postconditions:</i> <code>u == <del>a</del><ins>v</ins></code>.
</td>
<td>
linear
</td>
</tr>
<tr>
<td>
<code>X u(rv);<br/>
X u = rv;</code>
</td>
<td>
</td>
<td>
</td>
<td>
<i>Postconditions:</i> <code>u</code> is equal to the value<br/>
that <code>rv</code> had before this construction
</td>
<td>
(Note B)
</td>
</tr>
<tr>
<td>
<ins><code>t = v</code></ins>
</td>
<td>
<ins><code>X&amp;</code></ins>
</td>
<td>
</td>
<td>
<ins><i>Postconditions:</i> <code>t == v</code>.</ins>
</td>
<td>
<ins>linear</ins>
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>t</ins> = rv</code>
</td>
<td>
<code>X&amp;</code>
</td>
<td>
All existing elements<br/>
of <code><del>a</del><ins>t</ins></code> are either move<br/>
assigned to or<br/>
destroyed
</td>
<td>
<code><del>a</del><ins>t</ins></code> shall be equal to<br/>
the value that <code>rv</code> had<br/>
before this<br/>
assignment
</td>
<td>
linear
</td>
</tr>
<tr>
<td colspan="5" align="center">
<code>[&hellip;]</code>
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>c</ins> == b</code>
</td>
<td>
convertible to <code>bool</code>
</td>
<td>
<code>==</code> is an equivalence relation.<br/>
<code>equal(<del>a</del><ins>c</ins>.begin(),<br/>
<del>a</del><ins>c</ins>.end(),<br/>
b.begin(),<br/>
b.end())</code>
</td>
<td>
<i>Preconditions:</i> <code>T</code> meets the<br/> 
<i>Cpp17EqualityComparable</i> requirements
</td>
<td>
Constant if <code><del>a</del><ins>c</ins>.size() != b.size()</code>,<br/>
linear otherwise
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>c</ins> != b</code>
</td>
<td>
convertible to <code>bool</code>
</td>
<td>
Equivalent to <code>!(<del>a</del><ins>c</ins> == b)</code>
</td>
<td>
</td>
<td>
linear
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>t</ins>.swap(<del>b</del><ins>s</ins>)</code>
</td>
<td>
<code>void</code>
</td>
<td>
</td>
<td>
exchanges the<br/>
contents of <code><del>a</del><ins>t</ins></code> and <code><del>b</del><ins>s</ins></code>
</td>
<td>
(Note A)
</td>
</tr>
<tr>
<td>
<code>swap(<del>a</del><ins>t</ins>, <del>b</del><ins>s</ins>)</code>
</td>
<td>
<code>void</code>
</td>
<td>
<code><del>a</del><ins>t</ins>.swap(<del>b</del><ins>s</ins>)</code>
</td>
<td>
</td>
<td>
(Note A)
</td>
</tr>
<tr>
<td>
<del><code>r = a</code></del>
</td>
<td>
<del><code>X&amp;</code></del>
</td>
<td>
</td>
<td>
<del><i>Postconditions:</i> <code>r == a</code>.</del>
</td>
<td>
<del>linear</del>
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>c</ins>.size()</code>
</td>
<td>
<code>size_type</code>
</td>
<td>
<code>distance(<del>a</del><ins>c</ins>.begin(), <del>a</del><ins>c</ins>.end())</code>
</td>
<td>
</td>
<td>
constant
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>c</ins>.max_size()</code>
</td>
<td>
<code>size_type</code>
</td>
<td>
<code>distance(begin(), end())</code> for the largest<br/>
possible container
</td>
<td>
</td>
<td>
constant
</td>
</tr>
<tr>
<td>
<code><del>a</del><ins>c</ins>.empty()</code>
</td>
<td>
convertible to <code>bool</code>
</td>
<td>
<code><del>a</del><ins>c</ins>.begin() == <del>a</del><ins>c</ins>.end()</code>
</td>
<td>
</td>
<td>
constant
</td>
</tr>
</table>
</blockquote>
</li>
</ol>
</blockquote>

<p><i>[2022-04-20; Jonathan rebases the wording on the latest draft]</i></p>



<p><i>[2022-09-05; Reflector poll]</i></p>

<p>
Set status to Tentatively Ready after five votes in favour during reflector poll in April 2022.
</p>

<p><i>[2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting &rarr; WP.]</i></p>



<p id="res-3028"><b>Proposed resolution:</b></p>
<p>This wording is relative to <a href="https://wg21.link/n4910">N4910</a>.</p>

<ol>
<li><p>Change 23.2.2 <a href="https://wg21.link/container.requirements.general">[container.requirements.general]</a> as indicated:</p>

<blockquote class="note"><p>
[<i>Drafting note:</i>
</p>
<ul>
<li><p>It has been decided to replace the symbol <code>r</code> by <code>s</code>, because it is
easy to confuse with <code>rv</code> but means an lvalue instead, and the other container
tables use it rarely and for something completely different (iterator value)</p></li>
<li><p>A separate symbol <code>v</code> is introduced to unambigiously distinguish the
counterpart of a non-<code>const</code> rvalue (See 16.4.4.2 <a href="https://wg21.link/utility.arg.requirements">[utility.arg.requirements]</a>)</p></li>
<li><p>Two separate symbols <code>b</code> and <code>c</code> represent now "(possibly <code>const</code>)
values, while the existing symbol <code>a</code> represents an unspecified value, whose
meaning becomes defined when context is provided, e.g. for overloads like <code>begin()</code>
and <code>end</code></p></li>
</ul>
</blockquote>

<blockquote>
<p>
-1- In subclause  [container.gen.reqmts],
</p>
<ol style="list-style-type: none">
<li><p>(1.1) &mdash; <code>X</code> denotes a container class containing objects of type <code>T</code>,</p></li>
<li><p>(1.2) &mdash; <code>a</code> <del>and <code>b</code> denote values</del> <ins>denotes a value</ins> of type <code>X</code>,</p></li>
<li><p><ins>(?.?) &mdash; <code>b</code> and <code>c</code> denote values of type (possibly <code>const</code>) <code>X</code>,</ins></p></li>
<li><p>(1.3) &mdash; <code>i</code> and <code>j</code> denote values of type (possibly <code>const</code>) <code>X::iterator</code>,</p></li>
<li><p>(1.4) &mdash; <code>u</code> denotes an identifier,</p></li>
<li><p><ins>(?.?) &mdash; <code>v</code> denotes an lvalue of type (possibly <code>const</code>) <code>X</code> or an
rvalue of type <code>const X</code>,</ins></p></li>
<li><p>(1.5) &mdash; <del><code>r</code> denotes a</del><ins><code>s</code> and <code>t</code> denote</ins> non-<code>const</code> 
<del>value</del><ins>lvalues</ins> of type <code>X</code>, and</p></li>
<li><p>(1.6) &mdash; <code>rv</code> denotes a non-<code>const</code> rvalue of type <code>X</code>.</p></li>
</ol>
</blockquote>
</li>

<li><p>Change 23.2.2.2 <a href="https://wg21.link/container.reqmts">[container.reqmts]</a> as indicated:</p>

<blockquote class="note"><p>
[<i>Drafting note:</i> The following presentation also moves the copy-assignment expression just before
the move-assignment expression]
</p></blockquote>

<blockquote>
<pre>
  X u(<del>a</del><ins>v</ins>);
  X u = <del>a</del><ins>v</ins>;
</pre>
<p>-12- <i>Preconditions:</i>
<code>T</code> is <i>Cpp17CopyInsertable</i> into <code>X</code> (see below).
</p>
<p>-13- <i>Postconditions:</i>
<code>u == <del>a</del><ins>v</ins></code>.
</p>
<p>-14- <i>Complexity:</i> Linear.  </p>


<pre>
  X u(rv);
  X u = rv;
</pre>
<p>-15- <i>Postconditions:</i>
<code>u</code> is equal to the value
that <code>rv</code> had before this construction.
</p>
<p>-14- <i>Complexity:</i>
Linear for <code>array</code> and constant for all other standard containers.
</p>

<pre>
  <ins>t = v</ins>
</pre>
<p><ins>-?- <i>Result:</i> <code>X&amp;</code>.</ins> </p>
<p><ins>-?- <i>Postconditions:</i> <code>t == v</code>.</ins> </p>
<p><ins>-?- <i>Complexity:</i> Linear.</ins>  </p>

<pre>
  <del>a</del><ins>t</ins> = rv
</pre>
<p>-17- <i>Result:</i> <code>X&amp;</code>. </p>
<p>-18- <i>Effects:</i>
All existing elements of
<code><del>a</del><ins>t</ins></code>
are either move assigned to or destroyed.
</p>
<p>-19- <i>Postconditions:</i>
<code><del>a</del><ins>t</ins></code>
shall be equal to the value that <code>rv</code> had
before this assignment.
</p>
<p>-20- <i>Complexity:</i> Linear.  </p>

<p>[&hellip;]</p>

<pre>
  <del>a</del><ins>b</ins>.begin()
</pre>
<p>-24- <i>Result:</i> <code>iterator</code>; <code>const_iterator</code> for constant <del>a</del><ins>b</ins>. </p>
<p>-25- <i>Returns:</i>
An iterator referring to the first element in the container.
</p>
<p>-26- <i>Complexity:</i> Constant. </p>

<pre>
  <del>a</del><ins>b</ins>.end()
</pre>
<p>-27- <i>Result:</i> <code>iterator</code>; <code>const_iterator</code> for constant <del>a</del><ins>b</ins>. </p>
<p>-28- <i>Returns:</i>
An iterator which is the past-the-end value for the container.
</p>
<p>-29- <i>Complexity:</i> Constant. </p>

<pre>
  <del>a</del><ins>b</ins>.cbegin()
</pre>
<p>-30- <i>Result:</i> <code>const_iterator</code>. </p>
<p>-31- <i>Returns:</i>
<code>const_cast&lt;X const&amp;>(<del>a</del><ins>b</ins>).begin()</code>
</p>
<p>-32- <i>Complexity:</i> Constant. </p>

<pre>
  <del>a</del><ins>b</ins>.cend()
</pre>
<p>-33- <i>Result:</i> <code>const_iterator</code>. </p>
<p>-34- <i>Returns:</i>
<code>const_cast&lt;X const&amp;>(<del>a</del><ins>b</ins>).end()</code>
</p>
<p>-35- <i>Complexity:</i> Constant. </p>



<p>[&hellip;]</p>

<pre>
  <del>a</del><ins>c</ins> == b
</pre>
<p>-39- <i>Preconditions:</i>
<code>T</code> meets the <i>Cpp17EqualityComparable</i> requirements.
</p>
<p>-40- <i>Result:</i> Convertible to <code>bool</code>. </p>
<p>-41- <i>Returns:</i>
<code>equal(<del>a</del><ins>c</ins>.begin(),
<del>a</del><ins>c</ins>.end(),
b.begin(),
b.end())</code>.
</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; [<i>Note 1:</i>
The algorithm <code>equal</code> is defined in 26.6.13 <a href="https://wg21.link/alg.equal">[alg.equal]</a>.
<i>&mdash; end note</i>] </p>
<p>-42- <i>Complexity:</i>
Constant if <code><del>a</del><ins>c</ins>.size() != b.size()</code>,
linear otherwise.
</p>
<p>-43- <i>Remarks:</i>
<code>==</code> is an equivalence relation.</p>

<pre>
  <del>a</del><ins>c</ins> != b
</pre>
<p>-44- <i>Effects:</i> Equivalent to <code>!(<del>a</del><ins>c</ins> == b)</code>. </p>

<pre>
  <del>a</del><ins>t</ins>.swap(<del>b</del><ins>s</ins>)
</pre>
<p>-45- <i>Result:</i> <code>void</code>. </p>
<p>-46- <i>Effects:</i>
Exchanges the contents of
<code><del>a</del><ins>t</ins></code> and <code><del>b</del><ins>s</ins></code>.
</p>
<p>-47- <i>Complexity:</i>
Linear for <code>array</code> and constant for all other standard containers.
</p>

<pre>
  swap(<del>a</del><ins>t</ins>, <del>b</del><ins>s</ins>)
</pre>
<p>-48- <i>Effects:</i> Equivalent to
<code><del>a</del><ins>t</ins>.swap(<del>b</del><ins>s</ins>)</code>
</p>

<pre>
  <del>r = a</del>
</pre>
<p><del>-49- <i>Result:</i> <code>X&amp;</code>.</del> </p>
<p><del>-50- <i>Postconditions:</i> <code>r == a</code>.</del> </p>
<p><del>-51- <i>Complexity:</i> Linear.</del> </p>

<pre>
  <del>a</del><ins>c</ins>.size()
</pre>
<p>-52- <i>Result:</i> <code>size_type</code>. </p>
<p>-53- <i>Returns:</i>
<code>distance(<del>a</del><ins>c</ins>.begin(), <del>a</del><ins>c</ins>.end())</code>,
i.e. the number of elements in the container.
</p>
<p>-54- <i>Complexity:</i> Constant. </p>
<p>-55- <i>Remarks:</i>
The number of elements is defined by the rules of constructors, inserts, and erases.
</p>

<pre>
  <del>a</del><ins>c</ins>.max_size()
</pre>
<p>-56- <i>Result:</i> <code>size_type</code>. </p>
<p>-57- <i>Returns:</i>
<code>distance(begin(), end())</code> for the largest possible container.
</p>
<p>-58- <i>Complexity:</i> Constant. </p>

<pre>
  <del>a</del><ins>c</ins>.empty()
</pre>
<p>-59- <i>Result:</i> Convertible to <code>bool</code>. </p>
<p>-60- <i>Returns:</i>
<code><del>a</del><ins>c</ins>.begin() == <del>a</del><ins>c</ins>.end())</code>
</p>
<p>-61- <i>Complexity:</i> Constant. </p>
<p>-62- <i>Remarks:</i>
If the container is empty, then
<code><del>a</del><ins>c</ins>.empty()</code>
is <code>true</code>.
</p>
</blockquote>
</li>
</ol>





</body>
</html>
