<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 4178: writable is no longer a term of power</title>
<meta property="og:title" content="Issue 4178: writable is no longer a term of power">
<meta property="og:description" content="C++ library issue. Status: NAD Editorial">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue4178.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#NAD_Editorial">NAD Editorial</a> status.</em></p>
<h3 id="4178"><a href="lwg-closed.html#4178">4178</a>. <i>writable</i> is no longer a term of power</h3>
<p><b>Section:</b> 24.3.1 <a href="https://wg21.link/iterator.requirements.general">[iterator.requirements.general]</a>, 24.3.5.1 <a href="https://wg21.link/iterator.cpp17.general">[iterator.cpp17.general]</a>, 26.7.5 <a href="https://wg21.link/alg.replace">[alg.replace]</a>, 26.7.6 <a href="https://wg21.link/alg.fill">[alg.fill]</a>, 26.7.8 <a href="https://wg21.link/alg.remove">[alg.remove]</a>, 26.7.9 <a href="https://wg21.link/alg.unique">[alg.unique]</a>, 26.7.12 <a href="https://wg21.link/alg.random.sample">[alg.random.sample]</a>, 26.8.2.4 <a href="https://wg21.link/partial.sort.copy">[partial.sort.copy]</a>, 26.8.5 <a href="https://wg21.link/alg.partitions">[alg.partitions]</a>, 26.10.7 <a href="https://wg21.link/partial.sum">[partial.sum]</a>, 26.10.12 <a href="https://wg21.link/adjacent.difference">[adjacent.difference]</a>, 29.5.8.1 <a href="https://wg21.link/rand.util.seedseq">[rand.util.seedseq]</a> <b>Status:</b> <a href="lwg-active.html#NAD_Editorial">NAD Editorial</a>
 <b>Submitter:</b> Alisdair Meredith <b>Opened:</b> 2024-11-27 <b>Last modified:</b> 2024-12-04</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all other</b> <a href="lwg-index.html#iterator.requirements.general">issues</a> in [iterator.requirements.general].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#NAD Editorial">NAD Editorial</a> status.</p>
<p><b>Discussion:</b></p>
<p>
There are a numerous algorithms that mandate an iterator is "writable (24.3.1 <a href="https://wg21.link/iterator.requirements.general">[iterator.requirements.general]</a>)":
e.g., for the <code class='backtick'>std::fill</code> algorithm, 26.7.6 <a href="https://wg21.link/alg.fill">[alg.fill]</a> 26.7.6p2
</p>
<blockquote>
<p>
<i>Mandates</i>: The expression value is writable (24.3.1 <a href="https://wg21.link/iterator.requirements.general">[iterator.requirements.general]</a>) to the output iterator.
</p>
</blockquote>
<p>
However, checking 24.3.1 <a href="https://wg21.link/iterator.requirements.general">[iterator.requirements.general]</a> I can find no definition for the term "writable".
Checking past standards, I found that in C++17 we have the following definition:
</p>
<blockquote>
<p>
An output iterator <code class='backtick'>i</code> has a non-empty set of types that are <i>writable</i> to the iterator;
</p>
</blockquote>
<p>
However, when we introduced the concept-based iterator taxonomy, this definition was replaced by:
</p>
<blockquote>
<p>
An output iterator <code class='backtick'>i</code> has a non-empty set of types that are <code class='backtick'>indirectly_writable</code> to the iterator;
</p>
</blockquote>
<p>
where the term of power is no longer defined, but a concept is used to define the relationship between 
iterator and value instead. We need to either find and fix each reference to "writable" (or more properly 
"writable to" &mdash; the old term is a relationship between two types, not a property of just one) using 
the <code class='backtick'>indirectly_writable</code> concept, or restore a definition of the term of power &mdash; likely phrased in 
terms of the <code class='backtick'>indirectly_writable</code> concept.
<p/>
<b>Daniel:</b>
<p/>
It seems that the editorial direction of <a href="https://wg21.link/P1878R1" title=" Constraining Readable Types">P1878R1</a> accepted in Belfast 2019,
</p>
<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;">
<p>
Change stable name [iterator.concept.writable] to [iterator.concept.indirectly.writable] and globally
replace all occurrences of "<code>writable</code>" (the concept) with "<code>indirectly_writable</code>"
</p>
</blockquote>
<p>
has either been incorrectly applied 24.3.1 <a href="https://wg21.link/iterator.requirements.general">[iterator.requirements.general]</a> (because that position did not
actually refer to the <code>writable</code> concept) or if the interpretation that the original <i>writable</i>
definition from 24.3.1 <a href="https://wg21.link/iterator.requirements.general">[iterator.requirements.general]</a> was intended to be aliased with the <code>writable</code>
concept this substitution has been incompletely applied to the working draft.
</p>
<p><i>[2024-12-04 Status changed: New &rarr; NAD Editorial.]</i></p>



<p id="res-4178"><b>Proposed resolution:</b></p>
<p>
</p>





</body>
</html>
