simdjson/simdjson

Consider using "self-aware" data structures to provide schema as a possible API

Open

#484 创建于 2020年2月5日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)C++ (1,253 fork)batch import
discussionhelp wanted

仓库指标

Star
 (23,745 star)
PR 合并指标
 (平均合并 1天 17小时) (30 天内合并 14 个 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

贡献者指南