C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Extension to std::tuples to allow runtime indexing.

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Fri, 17 Apr 2026 09:52:13 -0400
On Fri, Apr 17, 2026 at 9:47 AM Muneem via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> What I meant is the choice is based on the implementation's reasoning on how runtime indexing should be done. Basically, it wont choose between deque or vector, it will choose one that is fit for runtime indexing and stick to it. Currently, what It sticks to is efficient only for space since the main goal is to provide compile time indexing.

My point is that it's not an either/or thing. Needing runtime indexing
is a static choice; you know at some point that you need to index the
tuple at runtime. That's core to the code you're writing.

But whether you need runtime indexing to be fast (again, ignoring
whether the bloated version is *ever* actually faster, which you've
yet to demonstrate) depends on how often you do it relative to
size-based operations. If you need the size-based performance, but
also need runtime indexing, what do you do?

Received on 2026-04-17 13:52:27