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

上周会议确定添加至 C++20 草案的新特性:
Modules!
Coroutines!
static, thread_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_evaluated, constexpr union, constexpr try and catch, constexpr dynamic_cast and typeid.
Feature test macros.
stdAPP软件开发.
::span
Synchronized output.
std::atomic_ref.
总之,C++20 应该会是一个像 C++11 那样的大版本。
据透露,工具研究小组 SG15 决定创建一个 C++ 生态系统技术报告,该报告将描述新模块化 C++ 世界中工具(构建系统等)的最佳实践和最新技术。
参考:http://www.hvihi.com
“沈阳软件公司”的新闻页面文章、图片、音频、视频等稿件均为自媒体人、第三方机构发布或转载。如稿件涉及版权等问题,请与
我们联系删除或处理,客服QQ:55506560,稿件内容仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同
其观点或证实其内容的真实性。
热门文章
使用“扫一扫”即可将网页分享至朋友圈。


