File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ class ViewReader {
7777 std::stringstream stream;
7878 stream << " Failed to parse field '" << name
7979 << " ': " << res.error ().what ();
80- _errors->emplace_back (Error (stream.str ()));
80+ auto err = Error{stream.str ()};
81+ _errors->emplace_back (std::move (err));
8182 return ;
8283 }
8384 if constexpr (std::is_pointer_v<OriginalType>) {
@@ -109,7 +110,8 @@ class ViewReader {
109110 std::stringstream stream;
110111 stream << " Failed to parse field '" << _current_name
111112 << " ': " << res.error ().what ();
112- _errors->emplace_back (Error (stream.str ()));
113+ auto err = Error{stream.str ()};
114+ _errors->emplace_back (std::move (err));
113115 return ;
114116 }
115117 extra_fields->emplace (std::string (_current_name), std::move (*res));
@@ -144,7 +146,8 @@ class ViewReader {
144146 if (!already_assigned) {
145147 std::stringstream stream;
146148 stream << " Value named '" << _current_name_or_index << " ' not used." ;
147- _errors->emplace_back (Error (stream.str ()));
149+ auto err = Error{stream.str ()};
150+ _errors->emplace_back (std::move (err));
148151 }
149152 }
150153 }
You can’t perform that action at this time.
0 commit comments