12
12
#ifndef BOOST_JSON_DETAIL_VALUE_TO_HPP
13
13
#define BOOST_JSON_DETAIL_VALUE_TO_HPP
14
14
15
+ #ifndef BOOST_JSON_INTRUSIVE_INDEX_INC
16
+ #define BOOST_JSON_INTRUSIVE_INDEX_INC ((void )0 );
17
+ #endif
18
+
19
+ #ifndef BOOST_JSON_INTRUSIVE_PATH_PUSH
20
+ #define BOOST_JSON_INTRUSIVE_PATH_PUSH (x ) ((void )0 );
21
+ #endif
22
+
23
+ #ifndef BOOST_JSON_INTRUSIVE_PATH_POP
24
+ #define BOOST_JSON_INTRUSIVE_PATH_POP ((void )0 );
25
+ #endif
26
+
27
+ #ifndef BOOST_JSON_INTRUSIVE_MESSAGE
28
+ #define BOOST_JSON_INTRUSIVE_MESSAGE (x ) ((void )0 );
29
+ #endif
30
+
31
+
15
32
#include < boost/json/value.hpp>
16
33
#include < boost/json/conversion.hpp>
17
34
#include < boost/json/result_for.hpp>
@@ -270,13 +287,21 @@ value_to_impl(
270
287
}
271
288
272
289
auto ins = detail::inserter (result, inserter_implementation<T>());
290
+
291
+ BOOST_JSON_INTRUSIVE_PATH_PUSH (-1 )
292
+
273
293
for ( value const & val: *arr )
274
294
{
295
+ BOOST_JSON_INTRUSIVE_INDEX_INC
296
+
275
297
auto elem_res = try_value_to<value_type<T>>( val, ctx );
276
298
if ( elem_res.has_error () )
277
299
return {boost::system ::in_place_error, elem_res.error ()};
278
300
*ins++ = std::move (*elem_res);
279
301
}
302
+
303
+ BOOST_JSON_INTRUSIVE_PATH_POP
304
+
280
305
return result;
281
306
}
282
307
@@ -373,10 +398,14 @@ struct to_described_member
373
398
system ::error_code ec;
374
399
BOOST_JSON_FAIL (ec, error::size_mismatch);
375
400
res = {boost::system ::in_place_error, ec};
401
+
402
+ BOOST_JSON_INTRUSIVE_MESSAGE (std::format (" the key >> {} << is non optional and missing in path {}" , D::name, BOOST_JSON_INTRUSIVE::composePath ()));
376
403
}
377
404
return ;
378
405
}
379
406
407
+ BOOST_JSON_INTRUSIVE_PATH_PUSH (D::name)
408
+
380
409
#if defined(__GNUC__) && BOOST_GCC_VERSION >= 80000 && BOOST_GCC_VERSION < 11000
381
410
# pragma GCC diagnostic push
382
411
# pragma GCC diagnostic ignored "-Wunused"
@@ -386,8 +415,10 @@ struct to_described_member
386
415
#if defined(__GNUC__) && BOOST_GCC_VERSION >= 80000 && BOOST_GCC_VERSION < 11000
387
416
# pragma GCC diagnostic pop
388
417
#endif
389
- if ( member_res )
418
+ if ( member_res ){
390
419
(*res).* D::pointer = std::move (*member_res);
420
+ BOOST_JSON_INTRUSIVE_PATH_POP
421
+ }
391
422
else
392
423
res = {boost::system ::in_place_error, member_res.error ()};
393
424
}
0 commit comments