bytedance / bytedance/sonic-cpp

Add more examples for Document API

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
C++
Stars
976
Forks
127
PR merge metrics
No merged PRs in 30d

Description

We need to add more examples for Document API into [example directory](https://github.com/bytedance/sonic-cpp/tree/master/example)

The example should be like follows:
```
#include
#include

#include "sonic/sonic.h"

int main() {
using NodeType = sonic_json::Node;
using Allocator = typename NodeType::AllocatorType;
sonic_json::Node node;
Allocator alloc;

node.SetObject();
node.AddMember("Key", NodeType("Value", alloc), alloc);
std::cout << "Add member successfully!\n";
return 0;
}
// g++ -I../include/ -march=haswell --std=c++11 get_and_set.cpp -o get_and_set
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.