#include #include #include using json = nlohmann::json; int main() { // a buffer containing a JSON text followed by more data std::vector input = {'[', '1', ',', '2', ',', '3', ']', 'o', 't', 'h', 'e', 'r'}; std::cout << std::boolalpha << json::accept(input.begin(), input.begin() + 7) << ' ' << json::accept(input.begin(), input.end()) << '\n'; }