simdjson/simdjson
Consider using "self-aware" data structures to provide schema as a possible API
开放
#484 创建于 2020年2月5日
discussionhelp wanted
仓库指标
- 星标
- (23,745 个星标)
- PR 合并指标
- (平均合并 3天 4小时) (30 天内合并 2 个 PR)
描述
If you expect a JSON to take the form
{"foo":1, "bar":1.0}
It would be nice to just do
typedef struct {int foo; double bar} mytype;
mytype x = parsejson(...);
I don't know how to do it as is, but we could use a self-aware data structure to achieve something of the sort...
using FooBar = Struct<foo<int>, bar<double>>;
auto x = parsejson<FoorBar>(...);
Reference: https://github.com/jckarter/selfaware cc @jckarter @jkeiser @DBJDBJ