T
traeai
登录
返回首页
InfoQ

C++26: Reflection, Memory Safety, Contracts, and a New Async Model

5.5Score
C++26: Reflection, Memory Safety, Contracts, and a New Async Model
AI 深度提炼
  • 文章仅有标题提及C++26四大特性,无实质技术细节
  • 正文被InfoQ网站模板、Cookie提示和注册引导占据
  • 无法验证所述C++26特性内容的真实性或深度
#C++#C++26#编程语言#内存安全#异步编程
打开原文

C++26: Reflection, Memory Safety, Contracts, and a New Async Model - InfoQ

Your choice regarding cookies on this site

We use cookies to optimise site functionality and give you the best possible experience.

I Accept I Do Not Accept Settings

[BT](http://www.infoq.com/int/bt/ "bt")

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

Enter your e-mail address

Select your country - [x] I consent to InfoQ.com handling my data as explained in this Privacy Notice.

We protect your privacy.

Close

Live Webinar and Q&A: Designing Data Layers for Agentic AI: Patterns for State, Memory, and Coordination at Scale (May 12, 2026)Save Your Seat

Close

Toggle Navigation

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

English edition

[Write for InfoQ](http://www.infoq.com/write-for-infoq/ "Write for InfoQ")

Search

RegisterSign in

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In

or

Don't have an InfoQ account?

Register

  • **Stay updated on topics and peers that matter to you**Receive instant alerts on the latest insights and trends.
  • **Quickly access free resources for continuous learning**Minibooks, videos with transcripts, and training materials.
  • **Save articles and read at anytime**Bookmark articles to read whenever youre ready.

Logo - Back to homepage

NewsArticlesPresentationsPodcastsGuides

Topics

[Development](http://www.infoq.com/development/ "Development")

  • [Java](http://www.infoq.com/java/ "Java")
  • [Kotlin](http://www.infoq.com/kotlin/ "Kotlin")
  • [.Net](http://www.infoq.com/dotnet/ ".Net")
  • [C#](http://www.infoq.com/c_sharp/ "C#")
  • [Swift](http://www.infoq.com/swift/ "Swift")
  • [Go](http://www.infoq.com/golang/ "Go")
  • [Rust](http://www.infoq.com/rust/ "Rust")
  • [JavaScript](http://www.infoq.com/javascript/ "JavaScript")

Featured in Development

Dany Lepage discusses the architectural journey of porting a hit VR title to seven non-VR platforms. He explains how his team solved the challenges of cross-progression, diverse input paradigms, and maintaining release velocity across Steam, iOS, and PlayStation. Beyond the tech, he shares candid lessons on the "product fit" gap when translating immersive social presence to 2D screens.

![Image 2: From VR to Flat Screens: Bridging the Input and Immersion Gap/presentations/game-vr-flat-screens/en/smallimage/thumbnail-1775637585504.jpg)](http://www.infoq.com/presentations/game-vr-flat-screens)

All in developmentFollow Topic

[Architecture & Design](http://www.infoq.com/architecture-design/ "Architecture & Design")

  • [Architecture](http://www.infoq.com/architecture/ "Architecture")
  • [Enterprise Architecture](http://www.infoq.com/enterprise-architecture/ "Enterprise Architecture")
  • [Scalability/Performance](http://www.infoq.com/performance-scalability/ "Scalability/Performance")
  • [Design](http://www.infoq.com/design/ "Design")
  • [Case Studies](http://www.infoq.com/Case_Study/ "Case Studies")
  • [Microservices](http://www.infoq.com/microservices/ "Microservices")
  • [Service Mesh](http://www.infoq.com/servicemesh/ "Service Mesh")
  • [Patterns](http://www.infoq.com/DesignPattern/ "Patterns")
  • [Security](http://www.infoq.com/Security/ "Security")

Featured in Architecture & Design

Randy Shoup discusses the "Velocity Initiative," a transformation that doubled engineering productivity and modernized eBay’s DORA metrics. He shares the technical playbook used to scale 4,500 services while explaining why even elite engineering execution can’t save a company hampered by waterfall planning, risk aversion, and a "pathological" culture of fear.

![Image 3: Platform Engineering: Lessons from the Rise and Fall of eBay Velocity/presentations/platform-engineering-lessons/en/smallimage/randy-shoup-thumbnail-1775637120944.jpg)](http://www.infoq.com/presentations/platform-engineering-lessons)

All in architecture-designFollow Topic

[AI Infrastructure](http://www.infoq.com/ai-ml-data-eng/ "AI Infrastructure")

  • [Big Data](http://www.infoq.com/bigdata/ "Big Data")
  • [Machine Learning](http://www.infoq.com/machinelearning/ "Machine Learning")
  • [NoSQL](http://www.infoq.com/nosql/ "NoSQL")
  • [Database](http://www.infoq.com/database/ "Database")
  • [Data Analytics](http://www.infoq.com/data-analytics/ "Data Analytics")
  • [Streaming](http://www.infoq.com/streaming/ "Streaming")

Featured in AI, ML & Data Engineering

Lakehouse architectures enable multiple engines to operate on shared data using open table formats such as Apache Iceberg. However, differences in SQL identifier resolution and catalog naming rules create interoperability failures. This article examines these behaviors and explains why enforcing consistent naming conventions and cross-engine validation is critical.

![Image 4: Lakehouse Tower of Babel: Handling Identifier Resolution Rules Across Database Engines/articles/lakehouse-sql-identifier-rules/en/smallimage/lakehouse-sql-identifier-rules-thumbnail-1776241856705.jpg)](http://www.infoq.com/articles/lakehouse-sql-identifier-rules)

All in ai-ml-data-engFollow Topic

[Culture & Methods](http://www.infoq.com/culture-methods/ "Culture & Methods")

  • [Agile](http://www.infoq.com/agile/ "Agile")
  • [Diversity](http://www.infoq.com/diversity/ "Diversity")
  • [Leadership](http://www.infoq.com/leadership/ "Leadership")
  • [Lean/Kanban](http://www.infoq.com/lean/ "Lean/Kanban")
  • [Personal Growth](http://www.infoq.com/personal-growth/ "Personal Growth")
  • [Scrum](http://www.infoq.com/scrum/ "Scrum")
  • [Sociocracy](http://www.infoq.com/sociocracy/ "Sociocracy")
  • [Software Craftmanship](http://www.infoq.com/software_craftsmanship/ "Software Craftmanship")
  • [Team Collaboration](http://www.infoq.com/team-collaboration/ "Team Collaboration")
  • [Testing](http://www.infoq.com/testing/ "Testing")
  • [UX](http://www.infoq.com/ux/ "UX")

Featured in Culture & Methods

Celine Pypaert discusses the ubiquitous nature of open-source software and shares a blueprint for securing modern applications. She explains how to prioritize high-risk vulnerabilities using exploitability data, the role of Software Bill of Materials (SBOM), and the importance of bridging the gap between DevOps and Security through clear accountability and automated governance.

![Image 5: Empower Your Developers: How Open Source Dependencies Risk Management Can Unlock Innovation/presentations/open-source-dependencies/en/smallimage/celine-pypaert-thumbnail-1775047335370.jpeg)](http://www.infoq.com/presentations/open-source-dependencies)

All in culture-methodsFollow Topic

DevOps

  • [Infrastructure](http://www.infoq.com/infrastructure/ "Infrastructure")
  • [Continuous Delivery](http://www.infoq.com/continuous_delivery/ "Continuous Delivery")
  • [Automation](http://www.infoq.com/automation/ "Automation")
  • [Containers](http://www.infoq.com/containers/ "Containers")
  • [Cloud](http://www.infoq.com/cloud-computing/ "Cloud")
  • [Observability](http://www.infoq.com/observability/ "Observability")

Featured in DevOps

Docker Extensions boost developer speed but create a "visibility gap" by isolating telemetry. To meet enterprise needs, extensions must act as bridges to centralized platforms. This article details how to use OpenTelemetry, policy-as-code, and encryption to build secure pipelines. Learn to balance developer productivity with the governance required for scalable, compliant observability.

![Image 6: Beyond One-Click: Designing an Enterprise-Grade Observability Extension for Docker/articles/enterprise-grade-observability-extension-docker/en/smallimage/enterprise-grade-observability-extension-docker-thumbnail-1775560652994.jpg)](http://www.infoq.com/articles/enterprise-grade-observability-extension-docker)

All in devopsFollow Topic

[Events](https://events.infoq.com/ "Events")

Helpful links

  • [About InfoQ](http://www.infoq.com/about-infoq "About InfoQ")
  • [InfoQ Editors](http://www.infoq.com/infoq-editors "InfoQ Editors")
  • [Write for InfoQ](http://www.infoq.com/write-for-infoq "Write for InfoQ")
  • [About C4Media](https://c4media.com/ "About C4Media")
  • [Diversity](https://c4media.com/diversity "Diversity")

Choose your language

  • [En](http://www.infoq.com/news/2026/04/cpp-26-reflection-safety-async/# "InfoQ English")
  • 中文
  • 日本
  • Fr

![Image 7: InfoQ Architect Certification - image Online InfoQ Architect Certification Join Luca Mezzalira for this 5-week online cohort. Master socio-technical architecture leadership. **Register Now.**](https://certification.qconferences.com/?utm_source=infoq&utm_medium=referral&utm_campaign=homepageheader_onlinecohortaprmayjun26)![Image 8: QCon AI Boston - image QCon AI Boston Learn how leading engineering teams run AI in production—reliably, securely, and at scale. **Early Bird ends April 14.**](https://boston.qcon.ai/?utm_source=infoq&utm_medium=referral&utm_campaign=homepageheader_qaiboston26)![Image 9: QCon San Francisco - image QCon San Francisco Learn what's next in AI and software, from teams already doing it. **Early Bird ends April 14.**](https://qconsf.com/?utm_source=infoq&utm_medium=referral&utm_campaign=homepageheader_qsf26)

[InfoQ Homepage](http://www.infoq.com/ "InfoQ Homepage")[News](http://www.infoq.com/news "News")C++26: Reflection, Memory Safety, Contracts, and a New Async Model

[Development](http://www.infoq.com/development/ "Development")

Shipping Faster, Breaking More: Rethinking Delivery Systems in the Age of AI (Webinar May 28th)

C++26: Reflection, Memory Safety, Contracts, and a New Async Model

Apr 17, 2026 2 min read

by

Follow

#### Write for InfoQ

**Feed your curiosity.**Help 550k+ global

senior developers

each month stay ahead.Get in touch

Log in to listen to this article

Loading audio

Your browser does not support the audio element.

0:00 0:00

Normal 1.25x 1.5x

Like

The C++26 standard draft is now complete, reports Herb Sutter, long-time C++ expert and former chair of the ISO C++ standards committee. The finalized draft introduces reflection, enhances memory safety without requiring code rewrites, adds contracts with preconditions and postconditions alongside a new assertion statement, and establishes a unified framework for concurrency and parallelism.

Reflection is a mechanism that, as Sutter explains, gives developers the keys to C++ internal machinery, enabling the language to describe itself and generate code, and thus provide a solid foundation for metaprogramming. True to C++'s spirit, reflection comes with no runtime overhead. As a basic example of what reflection allows, the following code snippet shows how reflection enables a specialized syntax for declaring C++ interfaces:

class(interface) IFoo {
    int f();
    void g(std::string);
};

//-- will be translated into the "classical":

class IFoo {
    public:
      virtual int f() = 0;
      virtual void g(std::string) = 0;
      virtual ~IFoo() = default;
      IFoo() = default;
    protected:
      IFoo(IFoo const&) = default;
      void operator=(IFoo const&) = default;
};
Reflection can simplify C++’s future evolution by reducing the need for as many bespoke new language features, since many can now be expressed as reusable compile-time libraries—faster to design, easier to test, and portable from day one.

The `interface` abstraction is part of cppfront, a compiler that builds to pure ISO C++, which Sutter created to provide a faster way to experiment with proposals. It also includes abstractions like `copyable` for expressing a type with copy/move construction/assignment; `ordered` for defining a totally ordered type with `operator<=>`; `union` for a tagged union with names; `regex`, and more.

Another area where C++26 aims to deliver significant improvements is memory safety. This includes out-of-the-box elimination of _undefined behavior_ when reading uninitialized local variables, as well as bounds safety for most standard library types, including `vector`, `span`, `string`, `string_view`. These changes have been already deployed in production at Apple and Google, Sutter says, across hundreds of millions of lines of C++ code:

This is no just-on-paper design. At Google alone, it has already fixed over 1,000 bugs, is projected to prevent 1,000 to 2,000 bugs a year, and has reduced the segfault rate across the production fleet by 30%.

Even more significantly, these benefits where achieved simply by recompiling existing code with the new compiler. In only seven cases was the compiler unable to analyze highly optimized code, requiring developers to use a fine-grained API to selectively opt out of memory safety in those specific parts.

C++26 contracts bring _defensive programming_ into the language, improving both functional and memory safety. They allow developers to express pre- and post-conditions that must not be violated across a method execution. Contracts allow to move assertions into function declarations making them visible to callers and static analysis tools. C++ offers four ways to handle contract violations: ignore, observe, enforce, and quick enforce. In addition, they bring a native assertion mechanism that replaces C's `assert` macro.

Finally, C++26 introduces `std::execution` as a framework to express and control concurrency and parallelism. The three main abstractions in the framework are _schedulers_, _senders_, and _receivers_, which can be composed through a set of customizable asynchronous algorithms. `std::execution` is designed to work nicely with C++20 coroutines and makes it easier to "write programs that use _structured_ (rigorously lifetime-nested) concurrency and parallelism to be data-race-free by construction".

The two major C++ compilers, GCC and Clang, have already implemented most of C++26 features during the standardization process and these features will soon make their way into mainline releases.

About the Author

![Image 11](http://www.infoq.com/profile/Sergio-De-Simone/)

#### **Sergio De Simone**

**Sergio De Simone** is a software engineer. Sergio has been working as a software engineer for over twenty five years across a range of different projects and companies, including such different work environments as Siemens, HP, and small startups. For the last 10+ years, his focus has been on development for mobile platforms and related technologies. He is currently working for BigML, Inc., where he leads iOS and macOS development.

Show more Show less

#### This content is in the Programming Languages topic

Follow Topic

##### Related Topics:

Followers: 4085

Follow Topic

Followers: 48

Follow Topic

Followers: 0

Follow Topic

Followers: 91

Follow Topic

* #### Related Editorial

* #### Related Sponsors

  • #### Related Sponsor

![Image 12: Related sponsor icon/filters:no_upscale()/sponsorship/topic/ad80a710-b4db-4a6e-a702-28ca161a5276/AblyLogoMicrosite-1774947433903.jpg)](http://www.infoq.com/url/f/04403af0-a7a1-4c42-a81d-fb03b2e1db18/)**Drop in Ably AI Transport.**

Purpose-built infrastructure for the entire agent-to-user experience. **Start building.**

Related Content

Apr 06, 2026

Apr 17, 2026

Apr 17, 2026

Apr 17, 2026

Apr 17, 2026 ![Image 13: Icon image/presentations/optimize-performance-cx-platform/en/smallimage/Matheus-Albuquerque-thumbnail-1775047866586.jpg)](http://www.infoq.com/presentations/optimize-performance-cx-platform/)

Apr 17, 2026 ![Image 14: Icon image/articles/lakehouse-sql-identifier-rules/en/smallimage/lakehouse-sql-identifier-rules-thumbnail-1776241856705.jpg)](http://www.infoq.com/articles/lakehouse-sql-identifier-rules/)

Apr 17, 2026

Apr 16, 2026

Apr 16, 2026

Related Sponsors

Every AI team hits the same wall and builds the same workaround. That's not a you problem. It's a missing layer. Read Now.

  • Sponsored by

![Image 16: Icon image/filters:no_upscale()/sponsorship/topic/ad80a710-b4db-4a6e-a702-28ca161a5276/AblyLogoMicrosite-1774947433903.jpg)](http://www.infoq.com/url/f/04403af0-a7a1-4c42-a81d-fb03b2e1db18/)

Related Content

Apr 16, 2026

Apr 16, 2026 ![Image 17: Icon image/presentations/game-vr-flat-screens/en/smallimage/thumbnail-1775637585504.jpg)](http://www.infoq.com/presentations/game-vr-flat-screens/)

Apr 16, 2026

Apr 16, 2026

Apr 15, 2026

Apr 15, 2026

**The InfoQ** Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

Enter your e-mail address

Select your country - [x] I consent to InfoQ.com handling my data as explained in this Privacy Notice.

We protect your privacy.

  • ##### [C++26: Reflection, Memory Safety, Contracts, and a New Async Model](http://www.infoq.com/news/2026/04/cpp-26-reflection-safety-async/ "C++26: Reflection, Memory Safety, Contracts, and a New Async Model")
  • ##### [From VR to Flat Screens: Bridging the Input and Immersion Gap](http://www.infoq.com/presentations/game-vr-flat-screens/ "From VR to Flat Screens: Bridging the Input and Immersion Gap")
  • ##### [Cursor 3 Introduces Agent-First Interface, Moving beyond the IDE Model](http://www.infoq.com/news/2026/04/cursor-3-agent-first-interface/ "Cursor 3 Introduces Agent-First Interface, Moving beyond the IDE Model")
  • ##### [Meta Reports 4x Higher Bug Detection with Just-in-Time Testing](http://www.infoq.com/news/2026/04/meta-jit-testing-ai-detection/ "Meta Reports 4x Higher Bug Detection with Just-in-Time Testing")
  • ##### [Cloudflare Launches Code Mode MCP Server to Optimize Token Usage for AI Agents](http://www.infoq.com/news/2026/04/cloudflare-code-mode-mcp-server/ "Cloudflare Launches Code Mode MCP Server to Optimize Token Usage for AI Agents")
  • ##### [Zendesk Says AI Makes Code Abundant, Shifting the Bottleneck to “Absorption Capacity”](http://www.infoq.com/news/2026/04/zendesk-absorption-capacity/ "Zendesk Says AI Makes Code Abundant, Shifting the Bottleneck to &ldquo;Absorption Capacity&rdquo;")
  • ##### [Platform as a Product: Delivering Value While Balancing Competing Priorities](http://www.infoq.com/news/2026/04/platform-product-deliver-value/ "Platform as a Product: Delivering Value While Balancing Competing Priorities")
  • ##### [Empower Your Developers: How Open Source Dependencies Risk Management Can Unlock Innovation](http://www.infoq.com/presentations/open-source-dependencies/ "Empower Your Developers: How Open Source Dependencies Risk Management Can Unlock Innovation")
  • ##### [Tiger Teams, Evals and Agents: The New AI Engineering Playbook](http://www.infoq.com/podcasts/tiger-teams-evals-agents/ "Tiger Teams, Evals and Agents: The New AI Engineering Playbook")
  • ##### [Anthropic Introduces Agent-Based Code Review for Claude Code](http://www.infoq.com/news/2026/04/claude-code-review/ "Anthropic Introduces Agent-Based Code Review for Claude Code")
  • ##### [Lakehouse Tower of Babel: Handling Identifier Resolution Rules Across Database Engines](http://www.infoq.com/articles/lakehouse-sql-identifier-rules/ "Lakehouse Tower of Babel: Handling Identifier Resolution Rules Across Database Engines")
  • ##### [Google Opens Gemma 4 Under Apache 2.0 with Multimodal and Agentic Capabilities](http://www.infoq.com/news/2026/04/google-gemm4/ "Google Opens Gemma 4 Under Apache 2.0 with Multimodal and Agentic Capabilities")
  • ##### [CNCF Warns Kubernetes Alone Is Not Enough to Secure LLM Workloads](http://www.infoq.com/news/2026/04/kubernetes-secure-workloads/ "CNCF Warns Kubernetes Alone Is Not Enough to Secure LLM Workloads")
  • ##### [OpenTelemetry Declarative Configuration Reaches Stability Milestone](http://www.infoq.com/news/2026/04/opentelemetry-declarative-config/ "OpenTelemetry Declarative Configuration Reaches Stability Milestone")
  • ##### [New Rowhammer Attacks on NVIDIA GPUs Enable Full System Takeover](http://www.infoq.com/news/2026/04/rowhammer-attacks-nvidia/ "New Rowhammer Attacks on NVIDIA GPUs Enable Full System Takeover")

**The InfoQ** Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

  • Get a quick overview of content published on a variety of innovator and early adopter technologies
  • Learn what you don’t know that you don’t know
  • Stay up to date with the latest information from the topics you are interested in

Enter your e-mail address

Select your country - [x] I consent to InfoQ.com handling my data as explained in this Privacy Notice.

We protect your privacy.

**May 7 | June 10, 2026 | Online** Architecture decisions are hard to validate while shipping. Join a **5-week online cohort** for **senior engineers, architects, and team leads** to pressure-test real decisions, apply practical frameworks, and work through challenges with a confidential peer group. Facilitated by Luca Mezzalira, Principal Architect at AWS, this cohort helps you: * Pressure-test real decisions. * Apply frameworks to real problems. * Publish on InfoQ.com and earn your certification. **RESERVE YOUR PLACE**

[Home](http://www.infoq.com/ "Home")[Create account](http://www.infoq.com/reginit.action "Create account")Log In[QCon Conferences](http://qconferences.com/ "QCon Conferences")Events[Write for InfoQ](http://www.infoq.com/write-for-infoq/ "Write for InfoQ")[InfoQ Editors](http://www.infoq.com/infoq-editors/ "InfoQ Editors")[About InfoQ](http://www.infoq.com/about-infoq/ "About InfoQ")[About C4Media](https://c4media.com/ "About C4Media")[Media Kit](https://get.infoq.com/infoq-mediakit/ "Media Kit")[InfoQ Developer Marketing Blog](https://devmarketing.c4media.com/?utm_source=infoq "InfoQ Developer Marketing Blog")[Diversity](https://c4media.com/diversity "Diversity")

#### Events

May 7, 2026

June 1-2, 2026

June 10, 2026

November 16-20, 2026

#### Follow us on

Youtube 232K FollowersLinkedin 26K FollowersRSS 19K ReadersX 57.1k FollowersFacebook 21K LikesBluesky New

#### Stay in the know

The InfoQ Podcast![Image 18: The InfoQ Podcast Logo - Stay in the know](http://www.infoq.com/podcasts/)Engineering Culture Podcast![Image 19: Engineering Culture Podcast Logo - Stay in the knoww](http://www.infoq.com/podcasts/#engineering_culture)The Software Architects' Newsletter![Image 20: The Software Architects' Newsletter Logo - Stay in the know](http://www.infoq.com/software-architects-newsletter/)

General Feedback [feedback@infoq.com](mailto:feedback@infoq.com) Advertising [sales@infoq.com](mailto:sales@infoq.com) Editorial [editors@infoq.com](mailto:editors@infoq.com) Marketing [marketing@infoq.com](mailto:marketing@infoq.com)

InfoQ.com and all content copyright © 2006-2026 C4Media Inc.

Privacy Notice, Terms And Conditions, Cookie Policy

Close

[BT](http://www.infoq.com/int/bt/ "bt")

问问这篇内容

回答仅基于本篇材料
    0 / 500

    Skill 包

    领域模板,一键产出结构化笔记
    • 论文精读包

      把一篇论文 / 技术博客精读成结构化笔记:问题、方法、实验、批判、延伸阅读。

      • · TL;DR(1 段)
      • · 研究问题与动机
      • · 方法概览
    • 投融资雷达包

      把一条融资 / 创投新闻整理成投资人视角的雷达卡:交易要点、判断、竞争格局、风险、尽调清单。

      • · 交易要点(公司 / 轮次 / 金额 / 投资人 / 估值,材料未明示则写 “未披露”)
      • · 投资 thesis(这家公司为什么值得关注)
      • · 竞争格局与替代方案

    导出到第二大脑

    支持 Notion / Obsidian / Readwise
    下载 Markdown(Obsidian 直接拖入)