Re: Possible extensions to OUString class

2019-01-31 Thread Michael Stahl
On 31.01.19 08:04, Matteo Casalin wrote: Hi Stephan, On 1/30/19 10:40 PM, Stephan Bergmann wrote: On 30/01/2019 22:17, Matteo Casalin wrote: I'm working on improving code that calls getToken (e.g. using its version with index, or using other OUString functions in its place when possible)

Re: Possible extensions to OUString class

2019-01-30 Thread Stephan Bergmann
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 (&&).

Re: Possible extensions to OUString class

2019-01-30 Thread Kaganski Mike
On 31.01.2019 0:40, Stephan Bergmann wrote: > Also, a better approach overall would probably be some string_view-based > getToken functionality (converting from an OUString to a string_view is > cheap), and then string_view-based toInt etc. functions. Is there a C++ magic to automatically select

Re: Possible extensions to OUString class

2019-01-30 Thread Matteo Casalin
Hi Stephan, On 1/30/19 10:40 PM, Stephan Bergmann wrote: On 30/01/2019 22:17, Matteo Casalin wrote: I'm working on improving code that calls getToken (e.g. using its version with index, or using other OUString functions in its place when possible). One thing that I noticed is that there a

Re: Possible extensions to OUString class

2019-01-30 Thread Stephan Bergmann
On 30/01/2019 22:17, Matteo Casalin wrote:     I'm working on improving code that calls getToken (e.g. using its version with index, or using other OUString functions in its place when possible). One thing that I noticed is that there are a lot of calls in the form getToken().toInt# which requ

Possible extensions to OUString class

2019-01-30 Thread Matteo Casalin
Dear all, I'm working on improving code that calls getToken (e.g. using its version with index, or using other OUString functions in its place when possible). One thing that I noticed is that there are a lot of calls in the form getToken().toInt# which require memory management just to obta