C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Fwd: Extension to runtime polymorphism proposed

From: Simon Schröder <dr.simon.schroeder_at_[hidden]>
Date: Wed, 8 Apr 2026 08:01:39 +0200
> On Apr 8, 2026, at 4:39 AM, Muneem via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> Mr.Simom proposed that we can expand tuples, but that would break zero abstraction principle.

The only thing I ever proposed for the expansion of std::tuple was to add operator[] which takes a runtime index and returns a std::variant (possibly with extension of std::variant to allow for references). The internal representation would not be changed (no ABI break!). And if you don’t use operator[] you don’t pay for it: zero abstraction principle: You don’t pay for what you don’t use!

Received on 2026-04-08 06:01:53