include/rtl/string.hxx  |   12 ++----------
 include/rtl/ustring.hxx |   24 ++----------------------
 2 files changed, 4 insertions(+), 32 deletions(-)

New commits:
commit b9ffee3074d8eb0e95b3d8f78cb7aac10b41c279
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed Sep 13 13:18:51 2023 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Sep 15 11:09:13 2023 +0200

    StringHolder detour is only really needed for ""_tstr
    
    Change-Id: Ifd3b21cdfa3738737b47fde0d014c312494227e3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156933
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index eae18bc30d0d..eb7f137a203c 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -146,7 +146,7 @@ private:
 
 public:
     // (Data members must be public so that OStringLiteral is a structural 
type that can be used as
-    // a non-type template parameter type for rtl::detail::OStringHolder:)
+    // a non-type template parameter type for operator ""_ostr and 
rtl::detail::OStringHolder:)
     union {
         rtl_String str;
         Data more = {};
@@ -2405,15 +2405,7 @@ constexpr
     rtlunittest::
 #endif
     OString
-operator ""_ostr() {
-    return
-#if defined RTL_STRING_UNITTEST
-        rtlunittest
-#else
-        rtl
-#endif
-        ::detail::OStringHolder<L>::literal;
-}
+operator ""_ostr() { return L; }
 
 template<
 #if defined RTL_STRING_UNITTEST
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index c273c76ace6a..34d4fd8f5be5 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -128,7 +128,7 @@ private:
 
 public:
     // (Data members must be public so that OUStringLiteral is a structural 
type that can be used as
-    // a non-type template parameter type for rtl::detail::OUStringHolder:)
+    // a non-type template parameter type for operator ""_ustr:)
     union {
         rtl_uString str;
         Data more = {};
@@ -175,18 +175,6 @@ private:
     rtl_uString* pData;
 };
 
-#if __cplusplus >= 202002L
-
-namespace detail {
-
-template<OUStringLiteral L> struct OUStringHolder {
-    static constexpr auto & literal = L;
-};
-
-}
-
-#endif
-
 /// @endcond
 #endif
 
@@ -3614,15 +3602,7 @@ constexpr
     rtlunittest::
 #endif
     OUString
-operator ""_ustr() {
-    return
-#if defined RTL_STRING_UNITTEST
-        rtlunittest
-#else
-        rtl
-#endif
-        ::detail::OUStringHolder<L>::literal;
-}
+operator ""_ustr() { return L; }
 
 #endif
 

Reply via email to