diff --git a/include/etl/basic_string.h b/include/etl/basic_string.h index 3a141606d..6d1092774 100644 --- a/include/etl/basic_string.h +++ b/include/etl/basic_string.h @@ -727,47 +727,6 @@ namespace etl assign(view.begin(), view.end()); } - //********************************************************************* - /// Assigns values to the string. - /// Truncates if the string does not have enough free space. - ///\param other The other string. - //********************************************************************* - void assign(const_pointer other) - { - assign(other, other + etl::strlen(other)); - } - - //********************************************************************* - /// Assigns values to the string. - /// Truncates if the string does not have enough free space. - ///\param other The other string. - ///\param length The length to copy. - //********************************************************************* - void assign(const_pointer other, size_type length_) - { - assign(other, other + length_); - } - - //********************************************************************* - /// Assigns values to the string from a view. - //********************************************************************* - template - void assign(const etl::basic_string_view& view) - { - assign(view.begin(), view.end()); - } - -#if ETL_USING_STL && ETL_USING_CPP17 - //********************************************************************* - /// Assigns values to the string from a view. - //********************************************************************* - template - void assign(const std::basic_string_view& view) - { - assign(view.begin(), view.end()); - } -#endif - //********************************************************************* /// Assigns values to the string. /// Truncates if the string does not have enough free space. @@ -1438,30 +1397,6 @@ namespace etl return find_impl(view.begin(), view.end(), view.size(), pos); } - //********************************************************************* - /// Find content within the string - ///\param view The content to find - ///\param pos The position to start searching from. - //********************************************************************* - template - size_type find(const etl::basic_string_view& view, size_type pos = 0) const - { - return find_impl(view.begin(), view.end(), view.size(), pos); - } - -#if ETL_USING_STL && ETL_USING_CPP17 - //********************************************************************* - /// Find content within the string - ///\param view The content to find - ///\param pos The position to start searching from. - //********************************************************************* - template - size_type find(const std::basic_string_view& view, size_type pos = 0) const - { - return find_impl(view.begin(), view.end(), view.size(), pos); - } -#endif - //********************************************************************* /// Find content within the string ///\param s Pointer to the content to find @@ -1527,30 +1462,6 @@ namespace etl return rfind_impl(view.rbegin(), view.rend(), view.size(), pos); } - //********************************************************************* - /// Find content within the string - ///\param view The content to find - ///\param pos The position to start searching from. - //********************************************************************* - template - size_type rfind(const etl::basic_string_view& view, size_type pos = 0) const - { - return rfind_impl(view.rbegin(), view.rend(), view.size(), pos); - } - -#if ETL_USING_STL && ETL_USING_CPP17 - //********************************************************************* - /// Find content within the string - ///\param view The content to find - ///\param pos The position to start searching from. - //********************************************************************* - template - size_type rfind(const std::basic_string_view& view, size_type pos = 0) const - { - return rfind_impl(view.rbegin(), view.rend(), view.size(), pos); - } -#endif - //********************************************************************* /// Find content within the string ///\param str The content to find diff --git a/include/etl/string_view.h b/include/etl/string_view.h index 7b60d8397..c3c7e80eb 100644 --- a/include/etl/string_view.h +++ b/include/etl/string_view.h @@ -167,18 +167,6 @@ namespace etl { } -#if ETL_USING_STL && ETL_USING_CPP17 - //************************************************************************* - /// Constructor from std::basic string_view - //************************************************************************* - template - explicit ETL_CONSTEXPR basic_string_view(const std::basic_string_view& other) ETL_NOEXCEPT - : mbegin(other.data()) - , mend(other.data() + other.size()) - { - } -#endif - //************************************************************************* /// Returns a const reference to the first element. //************************************************************************* diff --git a/test/test_string_view.cpp b/test/test_string_view.cpp index bc9404e61..afa1e6d33 100644 --- a/test/test_string_view.cpp +++ b/test/test_string_view.cpp @@ -169,86 +169,6 @@ namespace CHECK(isEqual); } -#if ETL_USING_STL && ETL_USING_CPP17 - //************************************************************************* - TEST(test_constructor_from_std_string_view) - { - std::string_view stdview(text.data(), text.size()); - - View view(stdview); - - CHECK(stdview.size() == view.size()); - CHECK(stdview.size() == view.max_size()); - - bool isEqual = std::equal(view.begin(), view.end(), stdview.begin()); - CHECK(isEqual); - } -#endif - -#if ETL_USING_STL && ETL_USING_CPP17 - //************************************************************************* - TEST(test_constructor_from_std_wstring_view) - { - std::wstring_view stdview(wtext.data(), wtext.size()); - - WView view(stdview); - - CHECK(stdview.size() == view.size()); - CHECK(stdview.size() == view.max_size()); - - bool isEqual = std::equal(view.begin(), view.end(), stdview.begin()); - CHECK(isEqual); - } -#endif - -#if ETL_USING_STL && ETL_USING_CPP20 - //************************************************************************* - TEST(test_constructor_from_std_u8string_view) - { - std::u8string_view stdview(u8text.begin(), u8text.end()); - - U8View view(stdview); - - CHECK(stdview.size() == view.size()); - CHECK(stdview.size() == view.max_size()); - - bool isEqual = std::equal(view.begin(), view.end(), stdview.begin()); - CHECK(isEqual); - } -#endif - -#if ETL_USING_STL && ETL_USING_CPP17 - //************************************************************************* - TEST(test_constructor_from_std_u16string_view) - { - std::u16string_view stdview(u16text.data(), u16text.size()); - - U16View view(stdview); - - CHECK(stdview.size() == view.size()); - CHECK(stdview.size() == view.max_size()); - - bool isEqual = std::equal(view.begin(), view.end(), stdview.begin()); - CHECK(isEqual); - } -#endif - -#if ETL_USING_STL && ETL_USING_CPP17 - //************************************************************************* - TEST(test_constructor_from_std_u32string_view) - { - std::u32string_view stdview(u32text.data(), u32text.size()); - - U32View view(stdview); - - CHECK(stdview.size() == view.size()); - CHECK(stdview.size() == view.max_size()); - - bool isEqual = std::equal(view.begin(), view.end(), stdview.begin()); - CHECK(isEqual); - } -#endif - //************************************************************************* TEST(test_constructor_pointer_size) {