ev-stdexec-template-lambda-completion-info-002¶
| 字段 | 值 |
|---|---|
| 项目 | NVIDIA/stdexec |
| 固定 commit | 6d7ad689f4d4 |
| 路径 | include/stdexec/__detail/__let.hpp |
| 行段 | L603-L613 |
| 特性 | 模板 lambda(template lambda) |
| 许可证 | Apache-2.0 |
| 代码来源 | 项目源码 |
| 级别 | manual |
| 审核 | zyuhao7 @ 2026-10-26 |
| 测试代码 | 否 |
| 发现方式 | manual |
用法¶
用模板 lambda 展开下标序列,聚合发送者的完成信息
为什么典型¶
lambda 模板参数 std::size_t... _Is 让下标包直接成为可推导参数,无需额外的辅助函数模板。
摘录¶
template <auto _Info, auto _Transform>
static constexpr auto __get_cmpl_info_i = []<std::size_t... _Is>(__indices<_Is...>)
{
return []
{
__static_vector<__completion_info, 0> __result;
// NB: this fold uses an overloaded addition operator that propagates
// __mexception objects when constexpr exceptions are not available.
return (__maybe_transform_cmplsig<_Info[_Is]>(_Transform) + ... + __result);
};
};
备注¶
生产路径;__get_cmpl_info_i 在编译期用折叠表达式聚合完成信息。