[Development] Views in APIs (was: Re: QString and related changes for Qt 6)

Marco Bubke Marco.Bubke at qt.io
Wed May 13 11:31:43 CEST 2020

auto view3 = myObject.getCopy()[42].getView(); // not safe, copy is destroyed

AFAIK you can say that a rvalue should not return a reference by using ref-qualified member functions.

View getView() const & { return v;}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200513/0100ec9a/attachment-0001.html>

More information about the Development mailing list