@@ -172,7 +172,7 @@ class binary_reader
172172 std::int32_t document_size{};
173173 get_number<std::int32_t , true >(input_format_t ::bson, document_size);
174174
175- if (JSON_HEDLEY_UNLIKELY (!sax->start_object (static_cast <std:: size_t >(- 1 ))))
175+ if (JSON_HEDLEY_UNLIKELY (!sax->start_object (detail::unknown_size ( ))))
176176 {
177177 return false ;
178178 }
@@ -394,7 +394,7 @@ class binary_reader
394394 std::int32_t document_size{};
395395 get_number<std::int32_t , true >(input_format_t ::bson, document_size);
396396
397- if (JSON_HEDLEY_UNLIKELY (!sax->start_array (static_cast <std:: size_t >(- 1 ))))
397+ if (JSON_HEDLEY_UNLIKELY (!sax->start_array (detail::unknown_size ( ))))
398398 {
399399 return false ;
400400 }
@@ -654,7 +654,7 @@ class binary_reader
654654 }
655655
656656 case 0x9F : // array (indefinite length)
657- return get_cbor_array (static_cast <std:: size_t >(- 1 ), tag_handler);
657+ return get_cbor_array (detail::unknown_size ( ), tag_handler);
658658
659659 // map (0x00..0x17 pairs of data items follow)
660660 case 0xA0 :
@@ -708,7 +708,7 @@ class binary_reader
708708 }
709709
710710 case 0xBF : // map (indefinite length)
711- return get_cbor_object (static_cast <std:: size_t >(- 1 ), tag_handler);
711+ return get_cbor_object (detail::unknown_size ( ), tag_handler);
712712
713713 case 0xC6 : // tagged item
714714 case 0xC7 :
@@ -1096,7 +1096,7 @@ class binary_reader
10961096 }
10971097
10981098 /* !
1099- @param[in] len the length of the array or static_cast<std::size_t>(-1 ) for an
1099+ @param[in] len the length of the array or detail::unknown_size( ) for an
11001100 array of indefinite size
11011101 @param[in] tag_handler how CBOR tags should be treated
11021102 @return whether array creation completed
@@ -1109,7 +1109,7 @@ class binary_reader
11091109 return false ;
11101110 }
11111111
1112- if (len != static_cast <std:: size_t >(- 1 ))
1112+ if (len != detail::unknown_size ( ))
11131113 {
11141114 for (std::size_t i = 0 ; i < len; ++i)
11151115 {
@@ -1134,7 +1134,7 @@ class binary_reader
11341134 }
11351135
11361136 /* !
1137- @param[in] len the length of the object or static_cast<std::size_t>(-1 ) for an
1137+ @param[in] len the length of the object or detail::unknown_size( ) for an
11381138 object of indefinite size
11391139 @param[in] tag_handler how CBOR tags should be treated
11401140 @return whether object creation completed
@@ -1150,7 +1150,7 @@ class binary_reader
11501150 if (len != 0 )
11511151 {
11521152 string_t key;
1153- if (len != static_cast <std:: size_t >(- 1 ))
1153+ if (len != detail::unknown_size ( ))
11541154 {
11551155 for (std::size_t i = 0 ; i < len; ++i)
11561156 {
@@ -2568,7 +2568,7 @@ class binary_reader
25682568 }
25692569 else
25702570 {
2571- if (JSON_HEDLEY_UNLIKELY (!sax->start_array (static_cast <std:: size_t >(- 1 ))))
2571+ if (JSON_HEDLEY_UNLIKELY (!sax->start_array (detail::unknown_size ( ))))
25722572 {
25732573 return false ;
25742574 }
@@ -2646,7 +2646,7 @@ class binary_reader
26462646 }
26472647 else
26482648 {
2649- if (JSON_HEDLEY_UNLIKELY (!sax->start_object (static_cast <std:: size_t >(- 1 ))))
2649+ if (JSON_HEDLEY_UNLIKELY (!sax->start_object (detail::unknown_size ( ))))
26502650 {
26512651 return false ;
26522652 }
@@ -2982,7 +2982,7 @@ class binary_reader
29822982 }
29832983
29842984 private:
2985- static JSON_INLINE_VARIABLE constexpr std::size_t npos = static_cast <std:: size_t >(- 1 );
2985+ static JSON_INLINE_VARIABLE constexpr std::size_t npos = detail::unknown_size( );
29862986
29872987 // / input adapter
29882988 InputAdapterType ia;
0 commit comments