前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >C++20 最新进展:已完成设计,加入模块和协程

C++20 最新进展:已完成设计,加入模块和协程

作者头像
Debian中国
发布2020-01-21 14:36:38
7190
发布2020-01-21 14:36:38
举报
文章被收录于专栏:Debian中国Debian中国Debian中国

C++ 委员会于上周在夏威夷科纳举办了一场官方 ISO 会议,以确定下一个国际标准 C++20 的功能集。

根据会议报告,C++20 的功能设计现已完成。计划于 2019 年 7 月在科隆举行的会议上,完成 C++20 的规范并发送一份委员会草案以供审查。

上周会议确定添加至 C++20 草案的新特性:

  • Modules!
  • Coroutines!
  • staticthread_local, and lambda capture for structured bindings.
  • std::polymorphic_allocator<>.
  • std::midpoint and std::lerp.
  • std::execution::unseq execution policy.
  • std::ssize() free function that returns a sized size.
  • std::span usability enhancements.
  • Precalculated hash values in lookup.

而以下的特性已在本次会议或之前的会议上获得了 C++20 批准,但尚未添加到 C++20 中,因为目前仍在完成规范。它们有望在 2019 年 7 月的科隆会议上被加入,不过由于时间限制,可能无法完成所有工作。

  • Expansion statements.
  • The C++20 synchronization library.
  • std::format.
  • constexpr std::vector.
  • Allow constexpr allocation, but disallow allocations that are not deleted at compile time.
  • constexpr std::type_info::operator==.
  • New conceptification of iterators.
  • Monadic operations for std::optional.
  • std::source_location.
  • std::flatmap.
  • std::flatset.
  • std::ostream_joiner.
  • Stack trace library.
  • std::byteswap.
  • constinit.
  • Deprecating some uses of volatile.
  • Implicit creation of objects for low-level object manipulation.
  • using enum.

而下面的这些特性,早已在之前的会议上获得了 C++ 20 批准。

  • Concepts.
  • Contracts.
  • Ranges.
  • operator<=>.
  • A lot more constexpr features: consteval functions, std::is_constant_evaluatedconstexpr unionconstexpr try and catchconstexpr dynamic_cast and typeid.
  • Feature test macros.
  • std::span.
  • Synchronized output.
  • std::atomic_ref.

总之,C++20 应该会是一个像 C++11 那样的大版本。

据透露,工具研究小组 SG15 决定创建一个 C++  生态系统技术报告 ,该 报告 将描述新模块化 C++ 世界中工具(构建系统等)的最佳实践和最新技术。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-02-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档