Replies: 2 comments 1 reply
-
|
Glaze requires this concept to pass: template <class Buffer>
concept output_buffer = range<Buffer> && (sizeof(range_value_t<Buffer>) == sizeof(char)) && non_const_buffer<Buffer>;You'd have to look into why template <class T>
concept range = requires(T& t) {
requires !std::same_as<void, decltype(t.begin())>;
requires !std::same_as<void, decltype(t.end())>;
requires std::input_iterator<decltype(t.begin())>;
}; |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I think I got it, to get glz::read_json parse beast::flat_buffer beast::flat_buffer beast_buff(/*omitted for brevity*/);
response_message_type msg;
auto buff = beast_buff.data().data(); // rather unsightly
// first data() to get asio::const_buffer from beast::flat_buffer,
// second to get void* from asio::const_buffer.
auto glz_buff = static_cast<char *>(buff);
auto ec = glz::read_json(msg, glz_buff);not entirely sure of the rationale, except some provision for multi-buffer sequence is being made in asio/beast and some abstraction layer does provide begin() and end() iterators, just not the flat_buffer itself. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a good technical reason I can't
write_json(msg, boost::beast::flat_buffer)directly?
Beta Was this translation helpful? Give feedback.
All reactions