diff --git a/include/gp/enveloppe/cbor.hpp b/include/gp/enveloppe/cbor.hpp index 65ab6d8..0b3dc45 100644 --- a/include/gp/enveloppe/cbor.hpp +++ b/include/gp/enveloppe/cbor.hpp @@ -88,7 +88,7 @@ namespace gp { using cbor_composite = gp::fixed_variant< undefined_t, cbor_number, - gp::buffer, + gp::vector, bool, gp::vector, gp::vector>, @@ -227,8 +227,8 @@ namespace gp { ref.value ); } - case cbor_composite::alt>(): { - auto& ref = contents.value>(); + case cbor_composite::alt>(): { + auto& ref = contents.value>(); auto it = encode_length( dest, cbor_type::bstr, diff --git a/tests/cbor_test.cpp b/tests/cbor_test.cpp index 5f40213..c7c1961 100644 --- a/tests/cbor_test.cpp +++ b/tests/cbor_test.cpp @@ -107,9 +107,12 @@ struct cbor_test : public test_scaffold { gp_config::assertion(serialized == serialized_manual, "data did not serialize correctly"); } { - gp::array str{'h', 'e', 'l', 'l', 'o'}; + gp::vector str{alloc}; + str.reserve(5); + for(auto a : {'h', 'e', 'l', 'l', 'o'}) + str.push_back((std::byte)a); gp::cbor_value data{alloc}; - data = str.as_buffer().cast(); + data = str; gp::array serialized; gp::array serialized_manual{