diff options
Diffstat (limited to 'src/catch2/internal/catch_stringref.hpp')
-rw-r--r-- | src/catch2/internal/catch_stringref.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_stringref.hpp b/src/catch2/internal/catch_stringref.hpp index bd8971bc..99bb9a98 100644 --- a/src/catch2/internal/catch_stringref.hpp +++ b/src/catch2/internal/catch_stringref.hpp @@ -13,6 +13,8 @@ #include <iosfwd> #include <cassert> +#include <cstring> + namespace Catch { /// A non-owning string class (similar to the forthcoming std::string_view) @@ -49,7 +51,10 @@ namespace Catch { } public: // operators - auto operator == ( StringRef other ) const noexcept -> bool; + auto operator == ( StringRef other ) const noexcept -> bool { + return m_size == other.m_size + && (std::memcmp( m_start, other.m_start, m_size ) == 0); + } auto operator != (StringRef other) const noexcept -> bool { return !(*this == other); } |