<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/september-18-2026-c1vxqpg7j" -->

---
title: September 18, 2026 | daily.dev
description: A comparison of how C++ handles exceptions across three concurrency-related mechanisms: magic statics (function-local static initialization), std::call_once,...
canonical: https://daily.dev/posts/september-18-2026-c1vxqpg7j
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: September 18, 2026 | daily.dev
og:description: A comparison of how C++ handles exceptions across three concurrency-related mechanisms: magic statics (function-local static initialization), std::call_once,...
og:url: https://daily.dev/posts/september-18-2026-c1vxqpg7j
og:image: https://api.daily.dev/og/posts/C1vxqpG7J.png
og:image:alt: September 18, 2026
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# September 18, 2026

**[The Old New Thing](https://daily.dev/sources/oldnewthing)** · 1 min read · 0 upvotes · 0 comments

## Summary

A comparison of how C++ handles exceptions across three concurrency-related mechanisms: magic statics (function-local static initialization), std::call_once, and std::async, focusing on whether each retries initialization/execution after an exception or permanently fails.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://devblogs.microsoft.com/oldnewthing/20260918-00>

## Questions this post answers

### What happens if the initialization of a C++ magic static throws an exception?

If a function-local static variable's initialization throws an exception, the initialization is considered not to have happened, so the next time control reaches that declaration, initialization is attempted again. This differs from std::call_once, which similarly retries after an exception, and from std::async, which does not retry and instead propagates the stored exception on every subsequent get() call.

_Developers debugging retry semantics in concurrent C++ code can track exception-handling nuances like these on daily.dev._

## Similar posts on daily.dev

- [September 16, 2026](https://daily.dev/posts/september-16-2026-pfsk1ai2l) · The Old New Thing · 0 upvotes · 0 comments
- [September 17, 2026](https://daily.dev/posts/september-17-2026-qc5lthami) · The Old New Thing · 0 upvotes · 0 comments
- [October 15, 2026](https://daily.dev/posts/october-15-2026-kn2umee1z) · The Old New Thing · 0 upvotes · 0 comments
- [December 22, 2025](https://daily.dev/posts/december-22-2025-axw3bxadg) · Hacker News · 2 upvotes · 0 comments
- [C\+\+26: Reflection, Memory Safety, Contracts, and a New Async Model](https://daily.dev/posts/c-26-reflection-memory-safety-contracts-and-a-new-async-model-qkor2ctht) · InfoQ · 18 upvotes · 2 comments

---

Tags: [#c++](https://daily.dev/tags/c++)

[View this post on daily.dev](https://daily.dev/posts/september-18-2026-c1vxqpg7j)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"September 18, 2026","url":"https://daily.dev/posts/september-18-2026-c1vxqpg7j","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/september-18-2026-c1vxqpg7j"},"datePublished":"2026-09-21T14:23:47.638Z","dateModified":"2026-09-21T14:27:38.204Z","description":"A comparison of how C++ handles exceptions across three concurrency-related mechanisms: magic statics (function-local static initialization), std::call_once,...","image":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","thumbnailUrl":"https://media.daily.dev/image/upload/s--58gMhC4P--/f_auto/v1722860399/public/Placeholder%2012","isAccessibleForFree":true,"articleSection":"The Old New Thing","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"The Old New Thing","logo":"https://media.daily.dev/image/upload/s--jKXDeorG--/f_auto,q_auto/v1783840773/logos/oldnewthing?_a=BAMAMicg0","url":"https://daily.dev/sources/oldnewthing"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/september-18-2026-c1vxqpg7j","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c++","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Old New Thing","item":"https://daily.dev/sources/oldnewthing"},{"@type":"ListItem","position":3,"name":"September 18, 2026"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/september-18-2026-c1vxqpg7j#faq","mainEntity":[{"@type":"Question","name":"What happens if the initialization of a C++ magic static throws an exception?","acceptedAnswer":{"@type":"Answer","text":"If a function-local static variable's initialization throws an exception, the initialization is considered not to have happened, so the next time control reaches that declaration, initialization is attempted again. This differs from std::call_once, which similarly retries after an exception, and from std::async, which does not retry and instead propagates the stored exception on every subsequent get() call. Developers debugging retry semantics in concurrent C++ code can track exception-handling nuances like these on daily.dev."}}]}
```

