You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that the values of string_view and byte_string_view in CBOR cursor / event_reader change when the cursor proceeds, for example:
vector<uint8_t> data;
cbor::encode_cbor(ojson::parse(R"({ "Hello World!": "Bye," })"), data);
cbor::cbor_bytes_cursor cur(data);
cur.next();
string_view s = cur.current().get<string_view>();
cout << s << endl;
cur.next();
cout << s << endl;
... results in following output:
Hello World!
Bye, World!
Maybe this is an absolute normal behavior but for non-C++-professionals it takes a bit of getting used to.
I haven't noticed this phenomenon with the JSON cursor yet, only with CBOR.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A lower priority question:
I have noticed that the values of
string_view
andbyte_string_view
in CBORcursor
/event_reader
change when the cursor proceeds, for example:... results in following output:
Maybe this is an absolute normal behavior but for non-C++-professionals it takes a bit of getting used to.
I haven't noticed this phenomenon with the JSON cursor yet, only with CBOR.
Beta Was this translation helpful? Give feedback.
All reactions