util/string: Delete cStr routines
The zstring class replaces these.
Change-Id: I64938b6f350c1f6e440113cd1c7eceb4c5fdfedf
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/include/stdplus/util/string.hpp b/include/stdplus/util/string.hpp
index 70af77d..2f1558a 100644
--- a/include/stdplus/util/string.hpp
+++ b/include/stdplus/util/string.hpp
@@ -40,27 +40,6 @@
} // namespace detail
-/** @brief Converts the string into its underlying nul-terminated c-str
- *
- * @param[in] str - The string reference
- * @return The c-str
- */
-template <typename Str, typename = std::enable_if_t<
- std::is_same_v<std::remove_cv_t<Str>, std::string>>>
-constexpr auto cStr(Str& str)
-{
- return str.data();
-}
-template <
- typename Str,
- typename = std::enable_if_t<
- std::is_pointer_v<Str> &&
- std::is_same_v<std::remove_cv_t<std::remove_pointer_t<Str>>, char>>>
-constexpr auto cStr(Str str)
-{
- return str;
-}
-
/** @brief Appends multiple strings to the end of the destination string
* in the most optimal way for the given inputs.
*
diff --git a/test/util/string.cpp b/test/util/string.cpp
index 26658a5..8ab4e81 100644
--- a/test/util/string.cpp
+++ b/test/util/string.cpp
@@ -13,18 +13,6 @@
using namespace std::string_literals;
using namespace std::string_view_literals;
-TEST(CStr, Basic)
-{
- std::string s1 = "a";
- EXPECT_EQ(s1, cStr(s1));
- const std::string s2 = "b";
- EXPECT_EQ(s2, cStr(s2));
- char s3[] = "c";
- EXPECT_EQ(s3, cStr(s3));
- const char* s4 = "d";
- EXPECT_EQ(s4, cStr(s4));
-}
-
TEST(StrCat, NoStr)
{
EXPECT_EQ("", strCat());