Skip to content

Commit 0600388

Browse files
committed
try_encode return value
1 parent 9eef819 commit 0600388

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

include/jsoncons/reflect/decode_traits.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ struct decode_traits
5858
{
5959
return result_type(jsoncons::unexpect, r1.error().code(), r1.error().message_arg(), line, column);
6060
}
61-
std::cout << "try_decode: " << *r1 << "\n";
6261
auto r2 = (*r1).template try_as<T>(aset);
6362
if (JSONCONS_UNLIKELY(!r2))
6463
{
@@ -459,7 +458,6 @@ struct decode_traits<T,
459458
}
460459
v.insert(std::move(*r));
461460
if (JSONCONS_UNLIKELY(ec)) {return result_type(jsoncons::unexpect, ec, cursor.line(), cursor.column());}
462-
//std::cout << "cursor.next 20\n";
463461
cursor.next(ec);
464462
if (JSONCONS_UNLIKELY(ec)) {return result_type{jsoncons::unexpect, ec, cursor.line(), cursor.column()};}
465463
}
@@ -520,7 +518,6 @@ struct decode_traits<T,
520518
}
521519
v.push_front(std::move(*r));
522520
if (JSONCONS_UNLIKELY(ec)) {return result_type(jsoncons::unexpect, ec, cursor.line(), cursor.column());}
523-
//std::cout << "cursor.next 20\n";
524521
cursor.next(ec);
525522
if (JSONCONS_UNLIKELY(ec)) {return result_type{jsoncons::unexpect, ec, cursor.line(), cursor.column()};}
526523
}
@@ -636,7 +633,6 @@ struct decode_traits<T,
636633
return result_type(jsoncons::unexpect, r2.error());
637634
}
638635
val.emplace(std::move(*r1), std::move(*r2));
639-
//std::cout << "cursor.next 300\n";
640636
cursor.next(ec);
641637
if (JSONCONS_UNLIKELY(ec))
642638
{
@@ -701,7 +697,6 @@ struct decode_traits<T,
701697
{
702698
return result_type{jsoncons::unexpect, json_errc::invalid_number, cursor.line(), cursor.column()};
703699
}
704-
//std::cout << "cursor.next 500\n";
705700
cursor.next(ec);
706701
if (JSONCONS_UNLIKELY(ec))
707702
{
@@ -713,7 +708,6 @@ struct decode_traits<T,
713708
return result_type(jsoncons::unexpect, r1.error());
714709
}
715710
val.emplace(n, std::move(*r1));
716-
//std::cout << "cursor.next 600\n";
717711
cursor.next(ec);
718712
if (JSONCONS_UNLIKELY(ec))
719713
{

include/jsoncons/reflect/reflect_traits_gen.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ else \
603603
#define JSONCONS_ALL_MEMBER_ENCODE_NAME_4(Member, Name, Mode, Match) JSONCONS_ALL_MEMBER_ENCODE_NAME_6(Member, Name, Mode, Match,,)
604604
#define JSONCONS_ALL_MEMBER_ENCODE_NAME_5(Member, Name, Mode, Match, Into) JSONCONS_ALL_MEMBER_ENCODE_NAME_6(Member, Name, Mode, Match, Into, )
605605
#define JSONCONS_ALL_MEMBER_ENCODE_NAME_6(Member, Name, Mode, Match, Into, From) \
606-
{auto r = try_encode_member(string_view_type(Name), val.Member, encoder); if (JSONCONS_UNLIKELY(!r)) {return r;}}
606+
{auto r = try_encode_member(string_view_type(Name), Into(val.Member), encoder); if (JSONCONS_UNLIKELY(!r)) {return r;}}
607607

608608
#define JSONCONS_MEMBER_NAME_COUNT(P1, P2, P3, Seq, Count) JSONCONS_MEMBER_NAME_COUNT_LAST(P1, P2, P3, Seq, Count)
609609
#define JSONCONS_MEMBER_NAME_COUNT_LAST(P1, P2, P3, Seq, Count) if ((num_params-Count) < num_mandatory_params2) JSONCONS_PP_EXPAND(JSONCONS_PP_CONCAT(JSONCONS_MEMBER_NAME_COUNT_,JSONCONS_NARGS Seq) Seq)

0 commit comments

Comments
 (0)