diff options
| author | Martin Hořeňovský | 2021-11-20 23:41:57 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-11-23 23:16:46 +0100 |
| commit | b9baae6d938133ff2fdc938053e88ccf51dd3afe (patch) | |
| tree | 7028372a8fe55e39a838f68fda28a4d1b80d9ec3 /src/catch2/internal/catch_stringref.cpp | |
| parent | c95072408fdb6e5cdff2a4d24b2eb991bc8f8ca0 (diff) | |
| download | catch3-b9baae6d938133ff2fdc938053e88ccf51dd3afe.tar.gz | |
Cleanup StringRef impl a bit
Diffstat (limited to 'src/catch2/internal/catch_stringref.cpp')
| -rw-r--r-- | src/catch2/internal/catch_stringref.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/catch2/internal/catch_stringref.cpp b/src/catch2/internal/catch_stringref.cpp index 0aa535db..82eef686 100644 --- a/src/catch2/internal/catch_stringref.cpp +++ b/src/catch2/internal/catch_stringref.cpp @@ -17,12 +17,12 @@ namespace Catch { : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) ) {} - auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool { + auto StringRef::operator == ( StringRef other ) const noexcept -> bool { return m_size == other.m_size && (std::memcmp( m_start, other.m_start, m_size ) == 0); } - bool StringRef::operator<(StringRef const& rhs) const noexcept { + bool StringRef::operator<(StringRef rhs) const noexcept { if (m_size < rhs.m_size) { return strncmp(m_start, rhs.m_start, m_size) <= 0; } @@ -50,8 +50,8 @@ namespace Catch { } } - auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& { - return os.write(str.data(), str.size()); + auto operator << ( std::ostream& os, StringRef str ) -> std::ostream& { + return os.write(str.data(), static_cast<std::streamsize>(str.size())); } std::string operator+(StringRef lhs, StringRef rhs) { @@ -62,7 +62,7 @@ namespace Catch { return ret; } - auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& { + auto operator+=( std::string& lhs, StringRef rhs ) -> std::string& { lhs.append(rhs.data(), rhs.size()); return lhs; } |