Do not require a default-constructible string_t in the BSON writer

GCC 4.9 and MSVC rejected the test's huge_string_t, which has no default
constructor; develop never default-constructed string_t here either.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-24 09:38:25 +02:00
parent 8e750bcd06
commit 66044eb3a6
2 changed files with 8 additions and 4 deletions
@@ -1372,7 +1372,8 @@ class binary_writer
// is in; nothing is allocated unless the document nests
bson_frame current(&document);
std::vector<bson_frame> parents;
string_t index_name;
// string_t need not be default constructible
string_t index_name("", 0);
while (true)
{
@@ -1459,7 +1460,8 @@ class binary_writer
bson_frame current(&document);
std::vector<bson_frame> parents;
std::size_t next_size = 0;
string_t index_name;
// string_t need not be default constructible
string_t index_name("", 0);
while (true)
{
+4 -2
View File
@@ -20334,7 +20334,8 @@ class binary_writer
// is in; nothing is allocated unless the document nests
bson_frame current(&document);
std::vector<bson_frame> parents;
string_t index_name;
// string_t need not be default constructible
string_t index_name("", 0);
while (true)
{
@@ -20421,7 +20422,8 @@ class binary_writer
bson_frame current(&document);
std::vector<bson_frame> parents;
std::size_t next_size = 0;
string_t index_name;
// string_t need not be default constructible
string_t index_name("", 0);
while (true)
{