diff --git a/doc/basics.md b/doc/basics.md index b67f7e1f..507c4377 100644 --- a/doc/basics.md +++ b/doc/basics.md @@ -180,7 +180,7 @@ In some cases, you may have valid JSON strings that you do not wish to parse but size_t length = strlen(some_string); // Create a buffer to receive the minified string. Make sure that there is enough room, // including some padding (simdjson::SIMDJSON_PADDING). - std::unique_ptr buffer{new(std::nothrow) char[length + simdjson::SIMDJSON_PADDING]}; + std::unique_ptr buffer{new(std::nothrow) char[length + simdjson::SIMDJSON_PADDING]}; size_t new_length{}; // It will receive the minified length. auto error = simdjson::minify_string(some_string, length, buffer.get(), new_length); // The buffer variable now has "[1,2,3,4]" and new_length has value 9. diff --git a/tests/basictests.cpp b/tests/basictests.cpp index c04467b9..9d72faeb 100644 --- a/tests/basictests.cpp +++ b/tests/basictests.cpp @@ -1717,7 +1717,7 @@ namespace type_tests { namespace minify_string_tests { bool check_minification(const char * input, size_t length, const char * expected, size_t expected_length) { - std::unique_ptr buffer{new(std::nothrow) char[length + simdjson::SIMDJSON_PADDING]}; + std::unique_ptr buffer{new(std::nothrow) char[length + simdjson::SIMDJSON_PADDING]}; if(buffer.get() == nullptr) { std::cerr << "cannot alloc " << std::endl; return false; diff --git a/tests/readme_examples.cpp b/tests/readme_examples.cpp index e61c984b..3a22ba06 100644 --- a/tests/readme_examples.cpp +++ b/tests/readme_examples.cpp @@ -242,7 +242,7 @@ SIMDJSON_POP_DISABLE_WARNINGS void minify_string() { const char * some_string = "[ 1, 2, 3, 4] "; size_t length = strlen(some_string); - std::unique_ptr buffer{new(std::nothrow) char[length + simdjson::SIMDJSON_PADDING]}; + std::unique_ptr buffer{new(std::nothrow) char[length + simdjson::SIMDJSON_PADDING]}; size_t new_length{}; auto error = simdjson::minify_string(some_string, length, buffer.get(), new_length); if(error != simdjson::SUCCESS) {