File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ struct result {
6464 return *this ;
6565 }
6666
67- auto get_message () const -> std::string {
67+ auto get_message () const & -> std::string {
6868 if (message.empty ()) {
6969 if (code != EXT_OK) {
7070 message = error_code_vo_string (code);
@@ -73,6 +73,15 @@ struct result {
7373 return message;
7474 }
7575
76+ auto get_message () && -> std::string {
77+ if (message.empty ()) {
78+ if (code != EXT_OK) {
79+ return error_code_vo_string (code);
80+ }
81+ }
82+ return std::move (message);
83+ }
84+
7685 auto get_code () const -> int {
7786 return code;
7887 }
@@ -222,13 +231,13 @@ struct typed_result {
222231 return _result.get_message ();
223232 }
224233 std::string message () && {
225- return std::move (std::move ( _result).get_message () );
234+ return std::move (_result).get_message ();
226235 }
227236 std::string get_message () const & {
228237 return _result.get_message ();
229238 }
230239 std::string get_message () && {
231- return std::move (std::move ( _result).get_message () );
240+ return std::move (_result).get_message ();
232241 }
233242
234243 bool ok () const {
You can’t perform that action at this time.
0 commit comments