Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_stringref.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2021-03-25 20:02:47 +0100
committerMartin Hořeňovský2021-03-26 21:11:44 +0100
commitf1d7a10e06f0f26d02e86c340d93a482b2c50e17 (patch)
tree392c56310e6ff1015b6b4ad29bc9fd3405023795 /src/catch2/internal/catch_stringref.cpp
parente50e10ef8f06dbeac8f92daffc9344bb7621daf1 (diff)
downloadcatch3-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.cpp')
-rw-r--r--src/catch2/internal/catch_stringref.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/catch2/internal/catch_stringref.cpp b/src/catch2/internal/catch_stringref.cpp
index a318857c..36a6d246 100644
--- a/src/catch2/internal/catch_stringref.cpp
+++ b/src/catch2/internal/catch_stringref.cpp
@@ -5,7 +5,6 @@
// https://www.boost.org/LICENSE_1_0.txt)
// SPDX-License-Identifier: BSL-1.0
-#include <catch2/internal/catch_enforce.hpp>
#include <catch2/internal/catch_stringref.hpp>
#include <algorithm>
@@ -18,11 +17,6 @@ namespace Catch {
: StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) )
{}
- auto StringRef::c_str() const -> char const* {
- CATCH_ENFORCE(isNullTerminated(), "Called StringRef::c_str() on a non-null-terminated instance");
- return m_start;
- }
-
auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool {
return m_size == other.m_size
&& (std::memcmp( m_start, other.m_start, m_size ) == 0);