<div dir="auto">I would like to however clarify that I dropped the &quot;tag&quot; as a part of the type and now there is a new type called runtime_indexed_tuple.  </div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, 18 Apr 2026, 8:42 am Jason McKesson via Std-Proposals, &lt;<a href="mailto:std-proposals@lists.isocpp.org">std-proposals@lists.isocpp.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Apr 17, 2026 at 10:27 PM Muneem via Std-Proposals<br>
&lt;<a href="mailto:std-proposals@lists.isocpp.org" target="_blank" rel="noreferrer">std-proposals@lists.isocpp.org</a>&gt; wrote:<br>
&gt;<br>
&gt; 1. My proposal uses a tag in std namespace and since std namespace is reserved, no one would be using it anyway(by defining their own tags).<br>
<br>
That changes nothing about what I said. None of my examples use<br>
specific typenames; they&#39;re all based on template deduction, which is<br>
done now.<br>
<br>
Look at implementations of `std::apply` and explain how it would work<br>
with a tagged tuple without changing its implementation.<br>
<br>
&gt; 2.i didn&#39;t meant a tag for current tuples because that&#39;s really not useful, since current tuples get their element from recursion,which though inefficient is efficient since it&#39;s at compile time. You will however need tags or other book keeping information at some point if you were to avoid such potentially inefficient recursive/looping patterns.<br>
<br>
>From the first sentence of your proposal:<br>
<br>
&gt; This proposal provides a specialization of std::tuple that can be indexed at runtime.<br>
<br>
You&#39;re asking to make a specialization of `std::tuple`, which is<br>
triggered by the use of a tag type.<br>
<br>
&gt; 3. Copying a my tuple would also be trivially copyable and explicit conversion to normal tuples.<br>
<br>
That&#39;s not possible.<br>
<br>
Remember how I brought up copy-on-write `std::string` implementations?<br>
That kind of implementation was made possible in C++98 by very<br>
particular wording around pointer/reference/iterator invalidation.<br>
C++11 shut down CoW strings by taking that particular wording away.<br>
<br>
I bring this up because a trivially copyable type cannot have pointers<br>
to itself. Well, they cannot *maintain* those pointers being pointers<br>
to themselves across a copy.<br>
<br>
If you have a type like this:<br>
<br>
```<br>
struct foo<br>
{<br>
  int i = 30;<br>
  int *pi = &amp;i;<br>
};<br>
```<br>
<br>
Value initialization for this object will leave it in a state where<br>
`pi` points to the `i` member of the object. But if you copy this<br>
object, the new copy&#39;s `pi` will not point to its own `i` member; it<br>
will point to the copied-from object&#39;s `i` member. Same goes for<br>
movement.<br>
<br>
In order to guarantee that the copied `pi` is a pointer to the<br>
internal object&#39;s `i` member and not someone elses, you need a copy<br>
constructor (and move constructor):<br>
<br>
```<br>
struct foo2<br>
{<br>
  foo2(foo2 const&amp; other) : i{other.i}, pi{&amp;i} {}<br>
<br>
  int i = 30;<br>
  int *pi = &amp;i;<br>
};<br>
```<br>
<br>
`foo2` is not trivially copyable.<br>
<br>
If `runtime_tuple` is trivially copyable, that will forbid the<br>
implementation from being able to maintain pointers to its members<br>
across copy/move operations. That is, if you want bookkeeping<br>
information to point to its members, it *cannot* be trivially<br>
copyable.<br>
<br>
It&#39;s one thing or the other. You cannot have both.<br>
-- <br>
Std-Proposals mailing list<br>
<a href="mailto:Std-Proposals@lists.isocpp.org" target="_blank" rel="noreferrer">Std-Proposals@lists.isocpp.org</a><br>
<a href="https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals" rel="noreferrer noreferrer" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals</a><br>
</blockquote></div>

