diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-09-13 13:18:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-09-15 11:09:13 +0200 |
commit | b9ffee3074d8eb0e95b3d8f78cb7aac10b41c279 (patch) | |
tree | cac833f23ccd0c611aa5bb27bace01251bfe3710 /include | |
parent | f1e4401dfbe7631de5de04960bebb72537618033 (diff) |
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 <sbergman@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/rtl/string.hxx | 12 | ||||
-rw-r--r-- | include/rtl/ustring.hxx | 24 |
2 files changed, 4 insertions, 32 deletions
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 |