Skip to content

Add C++20 Supports #1

Closed
Closed

Description

@changkun

需要支持以下内容:

  • 语言级 bug 与修订
  • 类型系统改进 Type Punning
  • 弃用和删除的功能
    • register
    • std::auto_ptr --> std::unique_ptr
    • std::random_shuffle
    • std::bind1st, std::bind2nd, ...
  • 语言增强
  • 结构化绑定 Structured bindings
  • 新的控制结构 constexpr if
  • 编译时条件语句 Compile-time conditional statements
  • 新的聚合规则
  • 强制性 RVO 和复制 elision, Guaranteed copy elision
  • Unary static_assert
  • 嵌套命名空间 Nested namespace deinitions
  • inline 变量 inline variables
  • constexpr 改进, constexpr lambda
  • 模板增强
  • 折叠表达式 Fold expressions
  • 类模板参数推导 Class template deduction
  • variadic templates fold
  • auto non-type template parameters
  • Preprocessor predicate for header testing (__has_include)
  • 容器
  • std::string_view, std::byte 加入 container 容器一章
  • std::any, std::variant, std::optional 加入 container 容器一章
  • 容器改进
  • 线程
  • 文件系统
  • 数学库
  • 其他特性
  • Polymorphic allocators and memory resources
  • Aligned new
  • Improved insertion and splicing for associative constrainers
  • Boolean logic metafunctions
    ...
  • 展望 C++20
  • concept
  • module
  • coroutine
  • Ranges

Activity

  1. changed the title [-]增加对 C++17 的支持[/-] [+]增加对 C++17 的支持(发布第二版)[/+] on Mar 26, 2018
  2. added a commit that references this issue on Mar 30, 2018
  3. self-assigned this
    on Mar 30, 2018
  4. added 6 commits that reference this issue on Mar 30, 2018
  5. added a commit that references this issue on May 6, 2018
  6. pinned this issue on Dec 19, 2018
  7. changed the title [-]增加对 C++17 的支持(发布第二版)[/-] [+]增加对 C++20 的支持(发布第二版)[/+] on Feb 26, 2019
  8. added a commit that references this issue on Jul 11, 2019
  9. 15 remaining items

  10. changkun commented on Jun 7, 2026

    @changkun
    OwnerAuthor

    Progress: added §2.7 covering three more C++17 language features (#322): inline variables, nested namespace definitions, and constexpr lambda — each with a runnable, compiled example under code/2. Boxes ticked above.

  11. changkun commented on Jun 7, 2026

    @changkun
    OwnerAuthor

    Progress: wrote Chapter 8 (filesystem) in full (was a TODO stub) with a runnable example, and added more C++17 features — new aggregate rules, boolean logic metafunctions, associative-container improvements (try_emplace/insert_or_assign/extract/merge), polymorphic allocators (std::pmr), and aligned new. All with compiled examples under code/. Boxes ticked above.

  12. changkun commented on Jun 7, 2026

    @changkun
    OwnerAuthor

    Closing: roadmap complete

    All checklist items above are now ticked, and the previously incomplete chapters have been written:

    Filled book content (zh + en, each with compiled code/ examples):

    • Chapter 8 (filesystem) — written from the stub: path, status queries (exception vs error_code), directory iteration, create/copy/remove, runnable example.
    • Chapter 10 (C++20) — Concepts, Modules, Ranges, Coroutines filled in; corrected the factual errors that Contracts (removed from C++20, now C++26 → Add C++26 Supports #318) and Transactional Memory (a TS) are not C++20 features.
    • Appendix 2 — modern C++ best practices written across all six sections.

    C++17 features added to chapters 2/3/4/9 (each with a compiled example):
    inline variables, nested namespaces, constexpr lambda, single-argument static_assert, new aggregate rules, boolean logic metafunctions, __has_include, guaranteed copy elision, std::string_view, std::byte, associative-container improvements, std::pmr, aligned new, type punning (std::memcpy/std::bit_cast), and math special functions (documented with a libc++ support caveat).

    Verification: all 20 new/changed code/ examples compile and run under the project's clang++ -std=c++2a -pedantic.

    Future standards are tracked separately in #317 (C++23) and #318 (C++26). Closing this as done.

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions