C++ Logo

std-proposals

Advanced search

Re: [std-proposals] DR - std::visit non-intuitive behavior + new semantic for C-style variadic functions + pattern matching but better

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Tue, 6 Jun 2023 19:43:40 +0100
On Tue, 6 Jun 2023 at 18:02, Nikl Kelbon via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> really no one want describe why visit([](...) {}, value) just compiles
> into undefined behavior? We want to not change THIS behavior in standard?
>

I'm struggling with this part:

It seems very logical to make just one function that would do nothing by
default so that the compiler would not have to instantiate it with all the
parameters:
std::visit([](...){}, x, x, x, x);

What's the point of a function that does nothing? Why is it very logical?

Received on 2023-06-06 18:43:55