diff options
| author | Martin Hořeňovský | 2021-03-25 20:02:47 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2021-03-26 21:11:44 +0100 |
| commit | f1d7a10e06f0f26d02e86c340d93a482b2c50e17 (patch) | |
| tree | 392c56310e6ff1015b6b4ad29bc9fd3405023795 /src/catch2/internal/catch_stringref.hpp | |
| parent | e50e10ef8f06dbeac8f92daffc9344bb7621daf1 (diff) | |
| download | catch3-f1d7a10e06f0f26d02e86c340d93a482b2c50e17.tar.gz | |
Remove StringRef::isNullTerminated and StringRef::c_str
Both of them were fundamentally unsafe to use and shouldn't be used
at all.
Diffstat (limited to 'src/catch2/internal/catch_stringref.hpp')
| -rw-r--r-- | src/catch2/internal/catch_stringref.hpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/src/catch2/internal/catch_stringref.hpp b/src/catch2/internal/catch_stringref.hpp index 33b35ef6..fed35b16 100644 --- a/src/catch2/internal/catch_stringref.hpp +++ b/src/catch2/internal/catch_stringref.hpp @@ -69,10 +69,6 @@ namespace Catch { return m_size; } - // Returns the current start pointer. If the StringRef is not - // null-terminated, throws std::domain_exception - auto c_str() const -> char const*; - public: // substrings and searches // Returns a substring of [start, start + length). // If start + length > size(), then the substring is [start, start + size()). @@ -91,10 +87,6 @@ namespace Catch { return m_start; } - constexpr auto isNullTerminated() const noexcept -> bool { - return m_start[m_size] == '\0'; - } - public: // iterators constexpr const_iterator begin() const { return m_start; } constexpr const_iterator end() const { return m_start + m_size; } |