mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-30 01:03:30 +01:00
Move strings in Clara's result type
This commit is contained in:
parent
3c5c86a4e4
commit
e539e1cb52
@ -224,13 +224,13 @@ namespace Catch {
|
|||||||
return { ResultType::Ok, value };
|
return { ResultType::Ok, value };
|
||||||
}
|
}
|
||||||
static auto ok() -> BasicResult { return { ResultType::Ok }; }
|
static auto ok() -> BasicResult { return { ResultType::Ok }; }
|
||||||
static auto logicError( std::string const& message )
|
static auto logicError( std::string&& message )
|
||||||
-> BasicResult {
|
-> BasicResult {
|
||||||
return { ResultType::LogicError, message };
|
return { ResultType::LogicError, CATCH_MOVE(message) };
|
||||||
}
|
}
|
||||||
static auto runtimeError( std::string const& message )
|
static auto runtimeError( std::string&& message )
|
||||||
-> BasicResult {
|
-> BasicResult {
|
||||||
return { ResultType::RuntimeError, message };
|
return { ResultType::RuntimeError, CATCH_MOVE(message) };
|
||||||
}
|
}
|
||||||
|
|
||||||
explicit operator bool() const {
|
explicit operator bool() const {
|
||||||
@ -256,8 +256,8 @@ namespace Catch {
|
|||||||
m_errorMessage; // Only populated if resultType is an error
|
m_errorMessage; // Only populated if resultType is an error
|
||||||
|
|
||||||
BasicResult( ResultType type,
|
BasicResult( ResultType type,
|
||||||
std::string const& message ):
|
std::string&& message ):
|
||||||
ResultValueBase<T>( type ), m_errorMessage( message ) {
|
ResultValueBase<T>( type ), m_errorMessage( CATCH_MOVE(message) ) {
|
||||||
assert( m_type != ResultType::Ok );
|
assert( m_type != ResultType::Ok );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user