@@ -124,8 +124,9 @@ class array : protected internal::tape_ref {
124124 * Get the next value.
125125 *
126126 * Part of the std::iterator interface.
127+ *
127128 */
128- inline void operator ++() noexcept ;
129+ inline iterator& operator ++() noexcept ;
129130 /* *
130131 * Check if these values come from the same place in the JSON.
131132 *
@@ -205,8 +206,9 @@ class object : protected internal::tape_ref {
205206 * Get the next key/value pair.
206207 *
207208 * Part of the std::iterator interface.
209+ *
208210 */
209- inline void operator ++() noexcept ;
211+ inline iterator& operator ++() noexcept ;
210212 /* *
211213 * Check if these key value pairs come from the same place in the JSON.
212214 *
@@ -373,13 +375,13 @@ class document {
373375 bool dump_raw_tape (std::ostream &os) const noexcept ;
374376
375377 /* * @private Structural values. */
376- std::unique_ptr<uint64_t []> tape;
378+ std::unique_ptr<uint64_t []> tape{} ;
377379
378380 /* * @private String values.
379381 *
380382 * Should be at least byte_capacity.
381383 */
382- std::unique_ptr<uint8_t []> string_buf;
384+ std::unique_ptr<uint8_t []> string_buf{} ;
383385
384386private:
385387 inline error_code allocate (size_t len) noexcept ;
@@ -660,8 +662,7 @@ class parser {
660662 * to allocate an initial capacity, call allocate() after constructing the parser.
661663 * Defaults to SIMDJSON_MAXSIZE_BYTES (the largest single document simdjson can process).
662664 */
663- really_inline parser (size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept ;
664-
665+ really_inline explicit parser (size_t max_capacity = SIMDJSON_MAXSIZE_BYTES) noexcept ;
665666 /* *
666667 * Take another parser's buffers and state.
667668 *
@@ -811,7 +812,7 @@ class parser {
811812 * - CAPACITY if the parser does not have enough capacity and batch_size > max_capacity.
812813 * - other json errors if parsing fails.
813814 */
814- inline document_stream load_many (const std::string &path, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept ;
815+ inline document_stream load_many (const std::string &path, size_t batch_size = DEFAULT_BATCH_SIZE) noexcept ;
815816
816817 /* *
817818 * Parse a buffer containing many JSON documents.
@@ -953,29 +954,29 @@ class parser {
953954 /* * @private Number of structural indices passed from stage 1 to stage 2 */
954955 uint32_t n_structural_indexes{0 };
955956 /* * @private Structural indices passed from stage 1 to stage 2 */
956- std::unique_ptr<uint32_t []> structural_indexes;
957+ std::unique_ptr<uint32_t []> structural_indexes{} ;
957958
958959 /* * @private Tape location of each open { or [ */
959- std::unique_ptr<scope_descriptor[]> containing_scope;
960+ std::unique_ptr<scope_descriptor[]> containing_scope{} ;
960961
961962#ifdef SIMDJSON_USE_COMPUTED_GOTO
962963 /* * @private Return address of each open { or [ */
963- std::unique_ptr<void *[]> ret_address;
964+ std::unique_ptr<void *[]> ret_address{} ;
964965#else
965966 /* * @private Return address of each open { or [ */
966- std::unique_ptr<char []> ret_address;
967+ std::unique_ptr<char []> ret_address{} ;
967968#endif
968969
969970 /* * @private Next write location in the string buf for stage 2 parsing */
970- uint8_t *current_string_buf_loc;
971+ uint8_t *current_string_buf_loc{} ;
971972
972973 /* * @private Use `if (parser.parse(...).error())` instead */
973974 bool valid{false };
974975 /* * @private Use `parser.parse(...).error()` instead */
975976 error_code error{UNINITIALIZED};
976977
977978 /* * @private Use `parser.parse(...).value()` instead */
978- document doc;
979+ document doc{} ;
979980
980981 /* * @private returns true if the document parsed was valid */
981982 [[deprecated(" Use the result of parser.parse() instead" )]]
0 commit comments