Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Fully Compatible
-
Quint Iteration 3.1.2
Description
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.