Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List index


On 31/01/2019 08:10, Kaganski Mike wrote:
Is there a C++ magic to automatically select a getToken variant
returning string_view vs returning OUString based on if the original
OUString object is a temporary?

Declare overloads discriminating on whether the OUString is lvalue (&) or rvalue (&&).

(Which, alas, is no panacea if forming a string_view over the temporary OUString would be fine because the string_view temporary doesn't outlive the full expression either. That is, you would like

  getSomeOUString().getToken(...).toInt32()

to use the string_view variant after all.)

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.