小编Jer*_*uah的帖子

VisitDecl与TraverseDecl(Clang RecursiveASTVisitor)

我已经阅读了此链接,但仍不完全了解TraverseDecl和VisitDecl(及其用例)之间有什么区别http://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html

编写RecursiveASTVisitor时应重写哪个方法?

c++ static-analysis clang abstract-syntax-tree llvm-clang

5
推荐指数
1
解决办法
1741
查看次数

访问来自nlohmann json的元素

我的JSON文件类似于此

{
  "active" : false,
  "list1" : ["A", "B", "C"],
  "objList" : [
    {
     "key1" : "value1",
     "key2" : [ 0, 1 ]
    }
   ]
}
Run Code Online (Sandbox Code Playgroud)

现在使用nlohmann json,我已经设法存储它,当我进行转储时jsonRootNode.dump(),内容被正确表示.

但是我找不到访问内容的方法.

我试过jsonRootNode["active"],jsonRootNode.get()并使用json::iterator,但仍然无法弄清楚如何找回我的内容.

我正在尝试从中检索"active"数组"list1"和来自的对象数组"objList"

c++ json

3
推荐指数
2
解决办法
7216
查看次数