C++ 委员会于上周在夏威夷科纳举办了一场官方 ISO 会议,以确定下一个国际标准 C++20 的功能集。
根据会议报告,C++20 的功能设计现已完成。计划于 2019 年 7 月在科隆举行的会议上,完成 C++20 的规范并发送一份委员会草案以供审查。
上周会议确定添加至 C++20 草案的新特性:
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.而以下的特性已在本次会议或之前的会议上获得了 C++20 批准,但尚未添加到 C++20 中,因为目前仍在完成规范。它们有望在 2019 年 7 月的科隆会议上被加入,不过由于时间限制,可能无法完成所有工作。
std::format
.constexpr
std::vector
.constexpr
allocation, but disallow allocations that are not deleted at compile time.constexpr
std::type_info::operator==
.std::optional
.std::source_location
.std::flatmap
.std::flatset
.std::ostream_joiner
.std::byteswap
.constinit
.volatile
.using enum
.而下面的这些特性,早已在之前的会议上获得了 C++ 20 批准。
operator<=>
.constexpr
features: consteval
functions, std::is_constant_evaluated
, constexpr
union
, constexpr
try
and catch
, constexpr
dynamic_cast
and typeid
.std::span
.std::atomic_ref
.总之,C++20 应该会是一个像 C++11 那样的大版本。
据透露,工具研究小组 SG15 决定创建一个 C++ 生态系统技术报告 ,该 报告 将描述新模块化 C++ 世界中工具(构建系统等)的最佳实践和最新技术。