C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Allow std::optional to give pointer to yet-to-be-constructed

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 13 Dec 2022 12:16:21 -0300
On Tuesday, 13 December 2022 09:47:41 -03 Frederick Virchanza Gotham via Std-
Proposals wrote:
> Just yesterday I wanted to do two things:
> (1) Show a dialog box
> (2) Start a new thread
>
> My debacle however was as follows:
> a) The constructor for the DialogBox needs the stop_token of the thread
> b) The entry point for the thread needs the address of the DialogBox

Is it not permitted to get the stop token of an unstarted jthread? The two
implementations I can see right now won't change that address after you assign
to the jthread, starting it.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DCAI Cloud Engineering

Received on 2022-12-13 15:16:25