|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4178" status="New"> |
| 5 | +<title><i>writable</i> is no longer a term of power</title> |
| 6 | +<section><sref ref="[iterator.requirements.general]"/><sref ref="[iterator.cpp17.general]"/> |
| 7 | +<sref ref="[alg.replace]"/><sref ref="[alg.fill]"/><sref ref="[alg.remove]"/> |
| 8 | +<sref ref="[alg.unique]"/><sref ref="[alg.random.sample]"/><sref ref="[partial.sort.copy]"/> |
| 9 | +<sref ref="[alg.partitions]"/><sref ref="[partial.sum]"/> |
| 10 | +<sref ref="[adjacent.difference]"/><sref ref="[rand.util.seedseq]"/></section> |
| 11 | +<submitter>Alisdair Meredith</submitter> |
| 12 | +<date>27 Nov 2024</date> |
| 13 | +<priority>99</priority> |
| 14 | + |
| 15 | +<discussion> |
| 16 | +<p> |
| 17 | +There are a numerous algorithms that mandate an iterator is "writable (<sref ref="[iterator.requirements.general]"/>)": |
| 18 | +e.g., for the `std::fill` algorithm, <sref ref="[alg.fill]"/> 26.7.6p2 |
| 19 | +</p> |
| 20 | +<blockquote> |
| 21 | +<p> |
| 22 | +<i>Mandates</i>: The expression value is writable (<sref ref="[iterator.requirements.general]"/>) to the output iterator. |
| 23 | +</p> |
| 24 | +</blockquote> |
| 25 | +<p> |
| 26 | +However, checking <sref ref="[iterator.requirements.general]"/> I can find no definition for the term "writable". |
| 27 | +Checking past standard, I found that in C++17 we have the following definition: |
| 28 | +</p> |
| 29 | +<blockquote> |
| 30 | +<p> |
| 31 | +An output iterator `i` has a non-empty set of types that are <i>writable</i> to the iterator; |
| 32 | +</p> |
| 33 | +</blockquote> |
| 34 | +<p> |
| 35 | +However, when we introduced the concept-based iterator taxonomy, this definition was replaced by: |
| 36 | +</p> |
| 37 | +<blockquote> |
| 38 | +<p> |
| 39 | +An output iterator `i` has a non-empty set of types that are `indirectly_writable` to the iterator; |
| 40 | +</p> |
| 41 | +</blockquote> |
| 42 | +<p> |
| 43 | +where the term of power is no longer defined, but a concept is used to define the relationship between |
| 44 | +iterator and value instead. We need to either find and fix each reference to "writable" (or more properly |
| 45 | +"writable to" — the old term is a relationship between two types, not a property of just one) using |
| 46 | +the `indirectly_writable` concept, or restore a definition of the term of power — likely phased in |
| 47 | +terms of the `indirectly_writable` concept. |
| 48 | +<p/> |
| 49 | +There is some urgency to this issue, as I am drafting wording for an EWG paper with a library component |
| 50 | +that should land for C++26, and I am modeling that wording on existing algorithms which is how I ran into |
| 51 | +this issue. It would be helpful to have a recommendation for how to write mandates clauses until this issue |
| 52 | +is resolved — should we perpetuate the bad "writable" wording to be part of a global fix, or attempt |
| 53 | +to use `indirectly_writable`, not knowing if that would be the preferred consistent direction for the future? |
| 54 | +<p/> |
| 55 | +<b>Daniel:</b> |
| 56 | +<p/> |
| 57 | +It seems that the editorial direction of <paper num="P1878R1"/> accepted in Belfast 2019, |
| 58 | +</p> |
| 59 | +<blockquote style="border-left: 3px solid #ccc;padding-left: 15px;"> |
| 60 | +<p> |
| 61 | +Change stable name [iterator.concept.writable] to [iterator.concept.indirectly.writable] and globally |
| 62 | +replace all occurrences of "<tt>writable</tt>" (the concept) with "<tt>indirectly_writable</tt>" |
| 63 | +</p> |
| 64 | +</blockquote> |
| 65 | +<p> |
| 66 | +has not been completed through-out the working draft. |
| 67 | +</p> |
| 68 | +</discussion> |
| 69 | + |
| 70 | +<resolution> |
| 71 | +<p> |
| 72 | +</p> |
| 73 | +</resolution> |
| 74 | + |
| 75 | +</issue> |
0 commit comments