败犬日报 2025-10-09
败犬日报 2025-10-09
1. 关于 UTF 编码的一个提案
https://github.com/bemanproject/utf_view
cpp
std::u32string hello_world =
u8"こんにちは世界" | beman::utf_view::to_utf32 | std::ranges::to<std::u32string>();
跟 ranges 契合非常好。
2. abbreviated function template (C++20)
模板的简写。
cpp
template <std::integral T>
void foo(T x) {}
// 可以简化为
void foo(std::integral auto x) {}