Regression in 4.2.0. Copying a built
Reproducer:
TEST_CASE("HELP-101966: builder appends empty string value", "[bsoncxx::builder::basic]") { using namespace builder::basic; // An empty string element copied out of a document and re-appended must // remain a string, not become null. builder::basic::document source; builder::basic::document copy; builder::basic::document expected; source.append(kvp("foo", "")); expected.append(kvp("foo", "")); auto const elem = source.view()["foo"]; copy.append(kvp(std::string{elem.key()}, elem.get_value())); viewable_eq_viewable(expected, copy); // Fails! // expected = { "foo" : "" } // basic = { "foo" : null } }