C++ Logo

std-proposals

Advanced search

Re: [std-proposals] void std::optional<T>::abandon(void) noexcept

From: Thiago Macieira <thiago_at_[hidden]>
Date: Tue, 28 Nov 2023 21:49:51 +0100
On Tuesday, 28 November 2023 13:01:23 CET Frederick Virchanza Gotham via Std-
Proposals wrote:
> And let's say I assign the return value of an invocation of 'async' to
> it. Later I wait on the future object for 3 seconds, and it's not
> ready after 3 seconds so I assume my thread is frozen and so I give up
> on it.

Read: "I have a bug in my software and I want to work around it".

You should fix the bug instead. Make your thread properly time out and give the
proper notification that it failed, so the future knows so.

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

Received on 2023-11-28 20:50:04