Skip to content

Add C++26 Supports #318

Closed
Closed

Description

@changkun

继 #1(C++20)与 C++23 追踪 issue 之后,追踪 C++26 的内容。注意 C++26 仍在最终定稿中(DIS 预计 2026 年),特性可能调整。以 cppreference: C++26 为准。

A tracking issue following #1 (C++20) and the C++23 issue. Note: C++26 is still being finalized (DIS expected in 2026); the feature set may still change. Source of truth: https://en.cppreference.com/w/cpp/26.

语言特性 / Language

  • 静态反射 / Static reflection(^^、splicing,P2996)
  • 契约 / Contracts(P2900)
  • 形参包索引 / pack indexing pack...[i]
  • = delete("reason")
  • 占位符 _ / placeholder with no name
  • 结构化绑定可作为条件 / structured bindings in conditions,结构化绑定中的包
  • 平凡可重定位 / trivially relocatable types
  • 用户生成的 static_assert 消息、constexpr 结构化绑定

标准库 / Library

  • std::execution(Senders/Receivers,P2300)
  • std::simd(<simd>)
  • std::hive
  • std::inplace_vector
  • std::function_ref
  • std::linalg(BLAS 接口)
  • std::text_encoding
  • std::span / std::mdspan 增强(submdspan、从 initializer_list 构造)
  • 加固标准库 / hardened library,std::is_within_lifetime
  • 调试支持 / debugging support(std::breakpoint、std::is_debugger_present)

Activity

  1. changkun commented on Jun 7, 2026

    @changkun
    OwnerAuthor

    ⚠️ Note: this checklist is a starting draft and must be reconciled against the official cppreference: C++26 page before use — C++26 is not yet finalized and the working draft is still changing. In particular, std::hive is uncertain (it has been targeted at C++26 repeatedly but may not have been voted in); verify it against cppreference before treating it as a C++26 feature.

  2. added a commit that references this issue on Jun 7, 2026
    f148826
  3. changkun commented on Jun 7, 2026

    @changkun
    OwnerAuthor

    Done — added Chapter 12 (C++26) as a forward-looking preview (bilingual), registered in the site build, with a prominent caveat that C++26 is not finalized and most features are unimplemented.

    Runnable examples under code/12 (verified with clang++ -std=c++2c): pack indexing, = delete("reason"), placeholder _, saturation arithmetic. Headline features not yet available (reflection, contracts, std::execution, std::simd, std::inplace_vector, std::function_ref, etc.) are documented with availability caveats, and std::hive is flagged as uncertain for C++26.

    All checklist items are now reflected in the chapter. As C++26 finalizes and toolchains catch up, the documented features should be revisited and upgraded to runnable examples. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions