File tree 2 files changed +9
-7
lines changed 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class conv_result
47
47
conv_result (std::error_code ec) noexcept
48
48
: has_value_(false ), ec_{ec}
49
49
{
50
+ ::new (&ec_) std::error_code (ec);
50
51
}
51
52
52
53
// copy constructors
@@ -59,7 +60,7 @@ class conv_result
59
60
}
60
61
else
61
62
{
62
- ec_ = other.ec_ ;
63
+ :: new (& ec_) std::error_code ( other.ec_ ) ;
63
64
}
64
65
}
65
66
@@ -73,7 +74,7 @@ class conv_result
73
74
}
74
75
else
75
76
{
76
- ec_ = other.ec_ ;
77
+ :: new (& ec_) std::error_code ( other.ec_ ) ;
77
78
}
78
79
}
79
80
@@ -91,7 +92,7 @@ class conv_result
91
92
else
92
93
{
93
94
destroy ();
94
- ec_ = other.ec_ ;
95
+ :: new (& ec_) std::error_code ( other.ec_ ) ;
95
96
}
96
97
return *this ;
97
98
}
@@ -105,7 +106,7 @@ class conv_result
105
106
else
106
107
{
107
108
destroy ();
108
- ec_ = other.ec_ ;
109
+ :: new (& ec_) std::error_code ( other.ec_ ) ;
109
110
}
110
111
return *this ;
111
112
}
Original file line number Diff line number Diff line change @@ -52,14 +52,15 @@ struct decode_traits
52
52
{
53
53
std::error_code ec;
54
54
55
- auto j = try_to_json<basic_json<CharT>>(cursor, ec);
55
+ using json_type = basic_json<CharT>;
56
+ auto j = try_to_json<json_type>(cursor, ec);
56
57
if (ec)
57
58
{
58
59
return result_type (read_error{ec, cursor.line (), cursor.column ()});
59
60
}
60
- auto result = reflect::json_conv_traits<decltype (j) , value_type>::try_as (j);
61
+ auto result = reflect::json_conv_traits<json_type , value_type>::try_as (j);
61
62
62
- return result ? result_type{ { std::move (result.value ()) } } : result_type{ { result.error (), cursor.line (), cursor.column ()} } ;
63
+ return result ? result_type ( std::move (result.value ())) : result_type (read_error{ result.error (), cursor.line (), cursor.column ()}) ;
63
64
}
64
65
};
65
66
You can’t perform that action at this time.
0 commit comments