Working with Asynchrony Generically: A Tour of C++ Executors
result of input sender to function, which returns new sender. when_all(senders...) → sender … completes when all the input senders complete. on(scheduler, sender) → sender … starts the input sender in in the context of the input scheduler. into_variant(sender) → sender … packages all possible results of input sender into a variant of tuples. bulk(sender, size, fn) → sender … launches a bulk operation cancels the other. It completes // with the result of `task` when both operations complete. // process input in a loop until the user interrupts: sender auto work_loop = unifex::stop_when( unifex::repeat_effect(0 码力 | 121 页 | 7.73 MB | 5 月前3C++高性能并行编程与优化 - 课件 - 17 由浅入深学习 map 容器
at(“hell”) 会直接报错,反而好排查。 [] 运用举例:出现次数统计 • vectorinput = {“hello”, “world”, “hello”}; • map counter; • for (auto const &key: input) { • counter[key]++; } • 则 counter 最后为: • {“hello”: 2, “world”: 1}; [] 运用举例:归类 • vector input = {“happy”, “world”, “hello”}; • map > categories; • for (auto const &str: input) { • char key = str[0]; • categories[key] 0 码力 | 90 页 | 8.76 MB | 1 年前3应用 waPC (rust) 做软件测试工具
WebAssembly 和 WebAssembly 调用本机代码的通信 (messaging) 和 错误处理 (error handling) 。 什么是 waPC? WASM 外部函数 接口 FFI Input type Return type Platform 底层 I32 I32 Unknown waPC &[u8] Result,error > Linux x86_64 0 码力 | 30 页 | 2.50 MB | 1 年前3C++高性能并行编程与优化 - 课件 - Zeno 中的现代 C++ 最佳实践
shared_ptr的缩 写) 一个节点的定义,以 MakeBoxPrimitive 为例 MaxBoxPrimitive 节点的内部: apply 的定义 通过 get_input (“name”) 获取端口名 name 上类型为 T 的对象,如果类型不是 T ,则出错。 NumericObject 的定义 • NumericObject 是基于 std::variant 0 码力 | 54 页 | 3.94 MB | 1 年前3C++高性能并行编程与优化 - 课件 - 14 C++ 标准库系列课 - 你所不知道的 set 容器
迭代器的五大分类 提供的运算符重载 具有此迭代器的容器 相应的 C++20 concept 输入迭代器 * (可读取), != , == , ++ (一次 性) istream_iterator input_iterator 输出迭代器 * (可写入), != , == , ++ (一次 性) back_insert_iterator output_iterator 前向迭代器 * , != ,0 码力 | 83 页 | 10.23 MB | 1 年前3C++23: An Overview of Almost All New and Updated Features
std::spanstream Defined in Allows to use stream operations on external buffers E.g. input: char data[] = "11 22"; std::ispanstream s { std::span {data} }; int a, b; s >> a >> b; 0 码力 | 105 页 | 759.96 KB | 5 月前3
共 6 条
- 1