mirror of
https://github.com/catchorg/Catch2.git
synced 2025-02-17 03:43:29 +01:00
Remove (mostly) unused overloads of StringRef operator +
This commit is contained in:
parent
293012a002
commit
9f4c4777a5
@ -53,10 +53,16 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string AssertionResult::getExpression() const {
|
std::string AssertionResult::getExpression() const {
|
||||||
if( isFalseTest( m_info.resultDisposition ) )
|
// Possibly overallocating by 3 characters should be basically free
|
||||||
return "!(" + m_info.capturedExpression + ")";
|
std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
|
||||||
else
|
if (isFalseTest(m_info.resultDisposition)) {
|
||||||
return static_cast<std::string>(m_info.capturedExpression);
|
expr += "!(";
|
||||||
|
}
|
||||||
|
expr += m_info.capturedExpression;
|
||||||
|
if (isFalseTest(m_info.resultDisposition)) {
|
||||||
|
expr += ')';
|
||||||
|
}
|
||||||
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string AssertionResult::getExpressionInMacro() const {
|
std::string AssertionResult::getExpressionInMacro() const {
|
||||||
|
@ -76,20 +76,6 @@ namespace Catch {
|
|||||||
return m_start[index];
|
return m_start[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string {
|
|
||||||
std::string str;
|
|
||||||
str.reserve( lhs.size() + rhs.size() );
|
|
||||||
str += lhs;
|
|
||||||
str += rhs;
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
auto operator + ( StringRef const& lhs, const char* rhs ) -> std::string {
|
|
||||||
return std::string( lhs ) + std::string( rhs );
|
|
||||||
}
|
|
||||||
auto operator + ( char const* lhs, StringRef const& rhs ) -> std::string {
|
|
||||||
return std::string( lhs ) + std::string( rhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
|
auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
|
||||||
return os.write(str.currentData(), str.size());
|
return os.write(str.currentData(), str.size());
|
||||||
}
|
}
|
||||||
|
@ -115,10 +115,6 @@ namespace Catch {
|
|||||||
auto isSubstring() const noexcept -> bool;
|
auto isSubstring() const noexcept -> bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto operator + ( StringRef const& lhs, StringRef const& rhs ) -> std::string;
|
|
||||||
auto operator + ( StringRef const& lhs, char const* rhs ) -> std::string;
|
|
||||||
auto operator + ( char const* lhs, StringRef const& rhs ) -> std::string;
|
|
||||||
|
|
||||||
auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
|
auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
|
||||||
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user