Skip to content

Commit

Permalink
D3559: Remove arturbac/small_vectors
Browse files Browse the repository at this point in the history
Artur points out that `is_relocatable` is no longer (was never?) used.
His `concepts::relocatable` is actually Niall Douglas's `move_relocates`,
not anything to do with triviality. So, remove small_vectors from the list.
  • Loading branch information
Quuxplusone committed Jan 8, 2025
1 parent fc4cf39 commit 3ebf49f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
12 changes: 5 additions & 7 deletions d3559-one-trait-or-two.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Title: `is_trivially_relocatable`: One trait or two?
Shortname: D3559
Revision: 0
!Draft Revision: 1
!Draft Revision: 2
Audience: EWG, LEWG
Status: D
Group: WG21
Expand Down Expand Up @@ -94,7 +94,6 @@ What sorts of names do libraries actually pick, in practice, for this type-trait
<tr><td>Google Skia</td><td><code>sk_is_trivially_relocatable</code></td></tr>
<tr><td>Subspace</td><td><code>sus::mem::TriviallyRelocatable</code></td></tr>
<tr><td>Thrust</td><td><code>thrust::is_trivially_relocatable</code></td></tr>
<tr><td>arturbac/small_vectors</td><td><code>small_vectors::is_relocatable_v</code></td></tr>
<tr><td>snncpp/snn-core</td><td><code>snn::is_trivially_relocatable</code></td></tr>
<tr><td>charles-salvia/std_error</td><td><code>stdx::is_trivially_relocatable</code></td></tr>
<tr><td>sarah-quinones/veg</td><td><code>veg::trivially_relocatable</code></td></tr>
Expand Down Expand Up @@ -200,7 +199,7 @@ by `lib::is_trivially_relocatable`. That is, property *P*.
In June 2024, Arthur [catalogued](https://quuxplusone.github.io/blog/2024/06/15/who-uses-trivial-relocation/)
21 libraries that use traits or algorithms relating in some way to "trivial relocation."

14 of these libraries define a single trait for property *P* (that is, P1144 semantics). Of those,
13 of these libraries define a single trait for property *P* (that is, P1144 semantics). Of those,
8 of them explicitly refer to P1144 and implement the set of library algorithms and/or
container optimizations that P1144 proposes.
5 libraries (listed in the timeline below) use P1144's feature-test macros.
Expand All @@ -216,7 +215,7 @@ Microsoft STL does not perform any relocation optimizations.

No library ever defines anything corresponding to P2786's `is_replaceable` as a standalone trait.

No library defines both a trait for property *P* and one for property *Q*. That is, the 14 libraries
No library defines both a trait for property *P* and one for property *Q*. That is, the 13 libraries
that care about *P* do not seem to care about *Q*; and the 2 libraries that seem to care about *Q* do not
seem to care about *P*. We can define a trait that captures most (but not all) of property *Q*...

Expand All @@ -229,7 +228,7 @@ namespace lib {
static_assert(lib::has_property_q<std::tuple<int&>>);
```

...but none of the 14 libraries above seem to care about capturing that particular
...but none of the 13 libraries above seem to care about capturing that particular
set of semantics; they're happy to capture property *P* alone. *P* is the property
most salient to their optimizations. We should give property *P* the good name.

Expand Down Expand Up @@ -271,8 +270,7 @@ libstdc++ adds `__is_bitwise_relocatable` with P1144 semantics
<tr><td>Nov</td><td> OleErikPeistorpet/OE-Lib changes from P1144 to P2786 semantics </td></tr>
<tr><td rowspan="2">2021</td><td>Feb</td><td> sarah-quinones/veg adds `trivially_relocatable` with P1144 semantics </td></tr>
<tr><td>Apr</td><td> Amadeus AMC uses `is_trivially_relocatable` with P1144 semantics </td></tr>
<tr><td rowspan="4">2022</td><td>Feb</td><td> arturbac/small_vectors uses `is_relocatable` with P1144 semantics </td></tr>
<tr><td>May</td><td> Subspace adds `relocate_one_by_memcpy` with P2786 semantics </td></tr>
<tr><td rowspan="3">2022</td><tr><td>May</td><td> Subspace adds `relocate_one_by_memcpy` with P2786 semantics </td></tr>
<tr><td>Sep</td><td> snncpp/snn-core uses `is_trivially_relocatable` with P1144 semantics </td></tr>
<tr><td>Oct</td><td> Google Skia adds `sk_is_trivially_relocatable` with P1144 semantics </td></tr>
<tr><td rowspan="5">2023</td><td>Jan</td><td> Subspace changes from P2786 to P1144 semantics </td></tr>
Expand Down
15 changes: 5 additions & 10 deletions d3559-one-trait-or-two.html
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,7 @@ <h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span cla
<dt>Project:
<dd>ISO/IEC 14882 Programming Languages — C++, ISO/IEC JTC1/SC22/WG21
<dt>Draft Revision:
<dd>1
<dd>2
</dl>
</div>
<div data-fill-with="warning"></div>
Expand Down Expand Up @@ -2211,9 +2211,6 @@ <h2 class="heading settled" data-level="2" id="background"><span class="secno">2
<tr>
<td>Thrust
<td><code class="highlight"><c- n>thrust</c-><c- o>::</c-><c- n>is_trivially_relocatable</c-></code>
<tr>
<td>arturbac/small_vectors
<td><code class="highlight"><c- n>small_vectors</c-><c- o>::</c-><c- n>is_relocatable_v</c-></code>
<tr>
<td>snncpp/snn-core
<td><code class="highlight"><c- n>snn</c-><c- o>::</c-><c- n>is_trivially_relocatable</c-></code>
Expand Down Expand Up @@ -2302,7 +2299,7 @@ <h2 class="heading settled" data-level="2" id="background"><span class="secno">2
by <code class="highlight"><c- n>lib</c-><c- o>::</c-><c- n>is_trivially_relocatable</c-></code>. That is, property <em>P</em>.</p>
<h2 class="heading settled" data-level="3" id="prefer"><span class="secno">3. </span><span class="content">Libraries overwhelmingly prefer a single trait</span><a class="self-link" href="#prefer"></a></h2>
<p>In June 2024, Arthur <a href="https://quuxplusone.github.io/blog/2024/06/15/who-uses-trivial-relocation/">catalogued</a> 21 libraries that use traits or algorithms relating in some way to "trivial relocation."</p>
<p>14 of these libraries define a single trait for property <em>P</em> (that is, P1144 semantics). Of those,
<p>13 of these libraries define a single trait for property <em>P</em> (that is, P1144 semantics). Of those,
8 of them explicitly refer to P1144 and implement the set of library algorithms and/or
container optimizations that P1144 proposes.
5 libraries (listed in the timeline below) use P1144’s feature-test macros.</p>
Expand All @@ -2314,7 +2311,7 @@ <h2 class="heading settled" data-level="3" id="prefer"><span class="secno">3. </
only to optimize vector reallocation, so they remain safe if either P1144 or P2786 is chosen.
Microsoft STL does not perform any relocation optimizations.</p>
<p>No library ever defines anything corresponding to P2786’s <code class="highlight"><c- n>is_replaceable</c-></code> as a standalone trait.</p>
<p>No library defines both a trait for property <em>P</em> and one for property <em>Q</em>. That is, the 14 libraries
<p>No library defines both a trait for property <em>P</em> and one for property <em>Q</em>. That is, the 13 libraries
that care about <em>P</em> do not seem to care about <em>Q</em>; and the 2 libraries that seem to care about <em>Q</em> do not
seem to care about <em>P</em>. We can define a trait that captures most (but not all) of property <em>Q</em>...</p>
<pre class="language-c++ highlight"><c- n>namespace</c-> <c- n>lib</c-> <c- p>{</c->
Expand All @@ -2324,7 +2321,7 @@ <h2 class="heading settled" data-level="3" id="prefer"><span class="secno">3. </
<c- p>}</c->
<c- k>static_assert</c-><c- p>(</c-><c- n>lib</c-><c- o>::</c-><c- n>has_property_q</c-><c- o>&lt;</c-><c- n>std</c-><c- o>::</c-><c- n>tuple</c-><c- o>&lt;</c-><c- b>int</c-><c- o>&amp;>></c-><c- p>);</c->
</pre>
<p>...but none of the 14 libraries above seem to care about capturing that particular
<p>...but none of the 13 libraries above seem to care about capturing that particular
set of semantics; they’re happy to capture property <em>P</em> alone. <em>P</em> is the property
most salient to their optimizations. We should give property <em>P</em> the good name.</p>
<h2 class="heading settled" data-level="4" id="timeline"><span class="secno">4. </span><span class="content">Timeline of P2786 and P1144</span><a class="self-link" href="#timeline"></a></h2>
Expand Down Expand Up @@ -2395,9 +2392,7 @@ <h2 class="heading settled" data-level="4" id="timeline"><span class="secno">4.
<td>Apr
<td> Amadeus AMC uses <code class="highlight"><c- n>is_trivially_relocatable</c-></code> with P1144 semantics
<tr>
<td rowspan="4">2022
<td>Feb
<td> arturbac/small_vectors uses <code class="highlight"><c- n>is_relocatable</c-></code> with P1144 semantics
<td rowspan="3">2022
<tr>
<td>May
<td> Subspace adds <code class="highlight"><c- n>relocate_one_by_memcpy</c-></code> with P2786 semantics
Expand Down

0 comments on commit 3ebf49f

Please sign in to comment.