On 2020-05-13 11:31, Marco Bubke wrote:
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;}
Qt is so many years behind the mainstream... This is a big problem in
ranges-v3, do you really believe no-one works on this?
https://github.com/isocpp/CppCoreGuidelines/blob/master/docs/Lifetime.pdf
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development