From d3a0815b12c0d040e99e22e53f6574726b868ec7 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 13 Oct 2023 22:53:16 +0200 Subject: Drop OStringConstExpr, use constexpr OString instead Change-Id: Ibb41a27fe7d5456d8db0c98821d5b2acf8586b70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157949 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/rtl/string.hxx | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'include/rtl') diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx index 6cc26e7befe3..de468f127757 100644 --- a/include/rtl/string.hxx +++ b/include/rtl/string.hxx @@ -153,39 +153,6 @@ public: }; }; -/** - This is intended to be used when declaring compile-time-constant structs or arrays - that can be initialised from named OStringLiteral e.g. - - constexpr OStringLiteral AAA = u"aaa"; - constexpr OStringLiteral BBB = u"bbb"; - constexpr OStringConstExpr FOO[] { AAA, BBB }; -*/ -class OString; -class OStringConstExpr -{ -public: - template constexpr OStringConstExpr(OStringLiteral const & literal): - pData(const_cast(&literal.str)) {} - - // prevent mis-use - template constexpr OStringConstExpr(OStringLiteral && literal) - = delete; - - // no destructor necessary because we know we are pointing at a compile-time - // constant OStringLiteral, which bypasses ref-counting. - - /** - make it easier to pass to OStringBuffer and similar without casting/converting - */ - constexpr std::string_view asView() const { return std::string_view(pData->buffer, pData->length); } - - inline operator const OString&() const; - -private: - rtl_String* pData; -}; - #if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED) namespace detail { @@ -2286,11 +2253,6 @@ public: #endif }; -#if defined LIBO_INTERNAL_ONLY -// Can only define this after we define OString -inline OStringConstExpr::operator const OString &() const { return OString::unacquired(&pData); } -#endif - #if defined LIBO_INTERNAL_ONLY inline bool operator ==(OString const & lhs, StringConcatenation const & rhs) { return lhs == std::string_view(rhs); } -- cgit