每日 Harness 开源 · Source
返回本期 · Back to 2026-06-16

博客文章 · Blog Posts2026-06-16 · Tuesday, June 16, 2026

Parsing JSON at compile time with C++26 static reflection

lemire.me原文 ↗

Parsing JSON at compile time with C++26 static reflection
Daniel Lemire 演示用 C++26 static reflection 在编译期解析 JSON。这个例子不是为了证明 JSON 必须编译期处理,而是展示 reflection 能否减少重复 schema 映射、字段注册和运行时解析样板。对 C++ 读者来说,看点在语言特性是否能把过去依赖宏、代码生成或手写 boilerplate 的任务搬进类型系统。
浏览

评论 · Comments