C++ Logo

std-proposals

Advanced search

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

From: Bjorn Reese <breese_at_[hidden]>
Date: Sat, 4 Apr 2026 16:02:54 +0200
On 4/4/26 15:52, Marcin Jaczewski wrote:

> Maybe a simple solution is `std::select` for tuple?
> Like:
>
> ```
> auto y = std::select([](auto& x) { return x.foo(); }, tuple, index);
> ```
>
> Why change language if standard lib can provide required function?
> It has all context and intend to create the most optimal code.

Yes, that is exactly what I suggested in an earlier reply.

In the meanwhile I have written a proof of concept:

   https://godbolt.org/z/94n6Y15bh

Received on 2026-04-04 14:02:56