<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 230: Assignable specified without also specifying CopyConstructible</title>
<meta property="og:title" content="Issue 230: Assignable specified without also specifying CopyConstructible">
<meta property="og:description" content="C++ library issue. Status: CD1">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue230.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#CD1">CD1</a> status.</em></p>
<h3 id="230"><a href="lwg-defects.html#230">230</a>. Assignable specified without also specifying CopyConstructible</h3>
<p><b>Section:</b> 16 <a href="https://wg21.link/library">[library]</a> <b>Status:</b> <a href="lwg-active.html#CD1">CD1</a>
 <b>Submitter:</b> Beman Dawes <b>Opened:</b> 2000-04-26 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View other</b> <a href="lwg-index-open.html#library">active issues</a> in [library].</p>
<p><b>View all other</b> <a href="lwg-index.html#library">issues</a> in [library].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#CD1">CD1</a> status.</p>
<p><b>Discussion:</b></p>
<p>Issue <a href="lwg-defects.html#227" title="std::swap() should require CopyConstructible or DefaultConstructible arguments (Status: TC1)">227</a><sup><a href="https://cplusplus.github.io/LWG/issue227" title="Latest snapshot">(i)</a></sup> identified an instance (std::swap) where
Assignable was specified without also specifying
CopyConstructible. The LWG asked that the standard be searched to
determine if the same defect existed elsewhere.</p>

<p>There are a number of places (see proposed resolution below) where
Assignable is specified without also specifying
CopyConstructible. There are also several cases where both are
specified. For example, 29.5.3 <a href="https://wg21.link/rand.req">[rand.req]</a>.</p>


<p id="res-230"><b>Proposed resolution:</b></p>
<p>In  23.2 <a href="https://wg21.link/container.requirements">[container.requirements]</a> table 65 for value_type:
change "T is Assignable" to "T is CopyConstructible and
Assignable&quot;
</p>

<p>In 23.2.7 <a href="https://wg21.link/associative.reqmts">[associative.reqmts]</a> table 69 X::key_type; change
&quot;Key is Assignable" to &quot;Key is
CopyConstructible and Assignable&quot;<br/>
</p>

<p>In 24.3.5.4 <a href="https://wg21.link/output.iterators">[output.iterators]</a> paragraph 1, change:
</p>
<blockquote>
<p> A class or a built-in type X satisfies the requirements of an
output iterator if X is an Assignable type (23.1) and also the
following expressions are valid, as shown in Table 73:
</p>
</blockquote>
<p>to:
</p>
<blockquote>
<p> A class or a built-in type X satisfies the requirements of an
output iterator if X is a CopyConstructible (20.1.3) and Assignable
type (23.1) and also the following expressions are valid, as shown in
Table 73:
</p>
</blockquote>

<p><i>[Post-Tokyo: Beman Dawes submitted this issue at the request of
the LWG.  He asks that the 26.7.5 <a href="https://wg21.link/alg.replace">[alg.replace]</a> and 26.7.6 <a href="https://wg21.link/alg.fill">[alg.fill]</a> changes be studied carefully, as it is not clear that
CopyConstructible is really a requirement and may be
overspecification.]</i></p>


<p><i>[Portions of the resolution for issue 230 have been superceded by
the resolution of issue <a href="lwg-defects.html#276" title="Assignable requirement for container value type overly strict (Status: CD1)">276</a><sup><a href="https://cplusplus.github.io/LWG/issue276" title="Latest snapshot">(i)</a></sup>.]</i></p>




<p><b>Rationale:</b></p>
<p>The original proposed resolution also included changes to input
iterator, fill, and replace.  The LWG believes that those changes are
not necessary.  The LWG considered some blanket statement, where an
Assignable type was also required to be Copy Constructible, but
decided against this because fill and replace really don't require the
Copy Constructible property.</p>




</body>
</html>
