Subject: Re: std::variant - going from Alternative& to the enclosing variant&
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2020-08-21 09:12:12
On Fri, 21 Aug 2020 at 17:07, Victor Khomenko via Std-Discussion
> Dear all,
> [I searched the list's archive but didn't find anything relevant.]
> Problem: How to change the value of a variant from within a visitor? Unfortunately, there is no straightforward way to do that, as the relevant operator()(Alternative&) of the visitor has no access to the enclosing std::variant.
Use a lambda as a visitor and capture the variant in the lambda?
STD-DISCUSSION list run by firstname.lastname@example.org
Older Archives on Google Groups