在cppnow 2023的演讲中,daisy展示了简化模板元算法的技巧。她以排序为例,通过将type_list中的每个Type映射到它们的index,然后对index数组进行排序,最终重新安放type_list中的元素。她展示了一个巧妙的排序算法,使用variant数组和std::visit访问数组中的元素。通过使用std::type_identity作为仿函数参数,解决了一些类型无法作为参数的问题。最后,她展示了如何根据类型的大小对type_list中的类型进行排序。
C++20引入了Ranges,提供了可组合数据集合转换的新方法。Microsoft的Tyler Whitney记录了标准库中可用的Range适配器,包括功能、构造方法、参数、成员、迭代器类型、元素类型、大小、是否可迭代等特性。用户可在Microsoft Learn上查看文档并提供反馈。
As you may have heard by now, Ranges got merged and will be part of C++20. This is huge news and represents probably the biggest shift the Standard Library has seen since it was first standardized...
Disclaimer: these are my early thoughts. None of this is battle ready. You’ve been warned. Hello, Coroutines! At the recent C++ Committee meeting in Toronto, the Coroutines TS was forwarded to ISO...
完成下面两步后,将自动完成登录并继续当前操作。