-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
Quint Iteration 3.1.2
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
The following StatusWith constructors are currently available for construction of an error StatusWith:
StatusWith( ErrorCodes::Error code, const std::string& reason, int location = 0 ) : _status( Status( code, reason, location ) ) { } StatusWith( const Status& status ) : _status( status ) { }
These constructors should take their const-reference arguments by value instead, to avoid unnecessary copies when a temporary is passed:
StatusWith( ErrorCodes::Error code, std::string reason, int location = 0 ) : _status( Status( code, std::move( reason ), location ) ) { } StatusWith( Status status ) : _status( std::move( status ) ) { }
Changing the three-argument StatusWith constructor requires also changing the respective three-argument Status constructor.