Date: Thu, 1 Jun 2023 18:00:50 +0200
Why should this be the algorithmic level, and container.empty() not?
What about, when I put the empty call in a sub-function, e.g.
bool check_conditions()
{
result = false;
// ... do many checks
return result && container.empty();
}
if (check_conditions())
push_back(1);
Will the scope of automatic/local variables within function check_conditions() be extended until the end of push_back()?
-----Ursprüngliche Nachricht-----
Von:Phil Bouchard <boost_at_[hidden]>
Gesendet:Do 01.06.2023 16:44
Betreff:Re: [std-proposals] Fwd: set_new_handler extension
An:std-proposals_at_[hidden];
CC:Sebastian Wittmeier <wittmeier_at_[hidden]>;
On 6/1/23 10:41, Sebastian Wittmeier via Std-Proposals wrote:
> What code would we write (with the lock behind the scenes) that the
> compiler does
>
> container.push_back(1);
>
> // the container should be locked here
>
> container.push_back(2);
>
> // the container should not be locked here
>
> container.push_back(3);
>
> with no other thread inserting or deleting in between 1 or 2, but
> possibly before 3?
>
> Or does it analyze and know that automatically?
No, that would be the algorithmic level where the compiler wouldn't
interfere at all.
--
Logo <https://www.fornux.com/>
*Phil Bouchard* facebook icon
<https://www.linkedin.com/in/phil-bouchard-5723a910/>
Founder & CEO
T: (819) 328-4743
E: phil_at_[hidden]| www.fornux.com <http://www.fornux.com>
8 rue de la Baie| Gatineau (Qc), J8T 3H3 Canada
Banner <https://goglobalawards.org/> Le message ci-dessus, ainsi que les
documents l'accompagnant, sont destinés uniquement aux personnes
identifiées et peuvent contenir des informations privilégiées,
confidentielles ou ne pouvant être divulguées. Si vous avez reçu ce
message par erreur, veuillez le détruire.
This communication (and/or the attachments) is intended for named
recipients only and may contain privileged or confidential information
which is not to be disclosed. If you received this communication by
mistake please destroy all copies.
Received on 2023-06-01 16:00:52