Date: Fri, 21 Aug 2020 17:12:12 +0300
On Fri, 21 Aug 2020 at 17:07, Victor Khomenko via Std-Discussion
<std-discussion_at_[hidden]> wrote:
>
> 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_at_[hidden]> wrote:
>
> 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?
Received on 2020-08-21 09:15:50