json
json copied to clipboard
Investigate generating into string from user structures directly
There is only issue about parsing here: https://github.com/boostorg/json/issues/627 But the generating is also actual question and it is also could potentially gain a lot of performance.
E.g.
template<class V, class OI>
void
generate_into(
OI sink,
const V& v);
std::vector<int> v{1, 2, 3};
std::string s;
boost::json::generate_into(std::back_inserter(s), v);
std::cout << s << std::endl; // [1, 2, 3]
This proof of concept already works: https://github.com/boostorg/json/pull/791
What is missing:
- tests
- metaprogramming
- fixes to the stack for alignment/space optimization
- documentation
- examples