danielaparker / jsoncons

A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
https://danielaparker.github.io/jsoncons
Other
699 stars 158 forks source link

basic_byte_string::append incorrect #425

Closed ergpudb closed 1 year ago

ergpudb commented 1 year ago

basic_byte_string::append calls this:

data_.insert(s, s+count);

However, std::vector::insert needs an insertion point specified as the first parameter, e.g.

data_.insert(data_.end(), s, s + count);

As is it fails to compile if append is called.

basic_byte_string::assign appears similarly incorrect.

v0.170.0 / gcc 11.3 / C++17 / Linux / x64

danielaparker commented 1 year ago

Thanks for reporting this, fixed on master.