标准委员会动态/ide/编译器信息放在这里
编译器信息最新动态推荐关注hellogcc公众号 本周更新 2023-08-02 第213期
写的不错
#include <ranges>
#include <vector>
#include <iostream>
int main() {
std::vector<int> r = {1, 2, 3, 4, 5};
auto reversed = r | std::views::reverse;
for (auto i : reversed)
std::cout << i << " ";
// same as:
//for (auto i : r | std::views::reverse)
//std::cout << i << " ";
std::cout << '\n';
std::ranges::reverse_view rv(r);
for (auto i : rv)
std::cout << i << " ";
}探讨这玩意是怎么实现的
帮你把结构体组成的数组这种行存转换为数组结构体模式列存
是代码帮你生成tuple。有点繁琐
static_assert(false, std::string_view{"message"});既然能string_view 也就可以fmt
没啥说的。能省点空间
template<typename T1, typename T2>
struct compressed_pair {
[[no_unique_address]] T1 first;
[[no_unique_address]] T2 second;
};介绍string对小字符串做的优化,类似clang::string的实现分析
光速入门
亮点还是扩容不需要迁移,很有意思
看不懂
meeting cpp推荐了十个,我把我感兴趣的列一下
Daniel Withopf - Compile-time Is the New Constexpr: Leveraging Compile-time Sparsity for Vectors and Matrices[10]
大概意思是利用constexpr算某些场景比elgen快
Filipp Gelman - What I learned From Sockets[11]
讲了一堆设计。没有代码,听个乐
std::embed没有之前能对付用的替代品
这哥们写了个find,和bfs一个原理,并发宽度优先遍历,find默认是dfs。
实际效果比find快百倍。很有意思。可以装一个玩玩
一个fat pointer实现
一个实现了work steal的线程池
关于 work steal,道理都懂,可能还需要看看https://www.youtube.com/watch?v=iLHNF7SgVN4&ab_channel=CppCon 了解下
有没有可以远程的工作可以推荐给我,我也快失业了
最近群里收集了一些想要讨论的点子,大家比较关注API设计,我这里把一些资料放在这里。可能后面会做个视频
https://www.youtube.com/watch?v=zL-vn_pGGgY&ab_channel=CppCon
https://www.youtube.com/watch?v=2UmDvg5xv1U&ab_channel=CppNow
https://www.acodersjourney.com/top-25-cplusplus-api-design-mistakes-and-how-to-avoid-them/
本文永久链接[16]
如果有疑问评论最好在上面链接到评论区里评论,这样方便搜索,微信公众号有点封闭/知乎吞评论
[1] RocksDB 源码阅读系列: https://zhuanlan.zhihu.com/p/646776844
[2] Understanding Ranges Views and View Adaptors Objects in C++20/C++23 : https://www.cppstories.com/2023/cpp20-understanding-views-impl/
[3] soagen: A Structure-of-Arrays generator for C++ : https://marzer.github.io/soagen/
[4] Did you know that C++26 added user-generated static_assert messages?: https://github.com/tip-of-the-week/cpp
[5] Inside STL: The pair and the compressed pair: https://devblogs.microsoft.com/oldnewthing/20230801-00/?p=108509
[6] Inside STL: The string: https://devblogs.microsoft.com/oldnewthing/20230803-00/?p=108532
[7] A Gentle Introduction to LLVM IR: https://mcyoung.xyz/2023/08/01/llvm-ir/
[8] MySQL · 源码剖析 · LF_HASH无锁实现: https://zhuanlan.zhihu.com/p/452849776
[9] Misinterpreting the misleadingly-named STATUS_STACK_BUFFER_OVERRUN: https://devblogs.microsoft.com/oldnewthing/20230731-00/?p=108505
[10] Daniel Withopf - Compile-time Is the New Constexpr: Leveraging Compile-time Sparsity for Vectors and Matrices: https://www.youtube.com/watch?v=PybIAMIZrVE&ab_channel=CppNow
[11] Filipp Gelman - What I learned From Sockets: https://www.youtube.com/watch?v=DA6AGCadH60&ab_channel=ACCUConference
[12] asteria: https://github.com/lhmouse/asteria
[13] Unilang: https://github.com/linuxdeepin/unilang
[14] gcc-mcf: https://gcc-mcf.lhmouse.com/
[15] battery-embed: https://github.com/batterycenter/embed
[16] 本文永久链接: https://wanghenshui.github.io/cppweeklynews/posts/125.html