[Development] QList for Qt 6

André Pönitz apoenitz at t-online.de
Wed May 22 20:31:54 CEST 2019


On Wed, May 22, 2019 at 09:02:13PM +0300, Konstantin Tokarev wrote:
> 
> 
> 22.05.2019, 20:55, "André Pönitz" <apoenitz at t-online.de>:
> > On Wed, May 22, 2019 at 07:41:42PM +0300, Konstantin Tokarev wrote:
> >>  22.05.2019, 19:38, "Philippe" <philwave at gmail.com>:
> >>  >>  People tend to use QList as a deque because of the fast prepend/take first
> >>  >
> >>  > Simply, QArrayList should not be deprecated.
> >>  > It is also useful to store large objects that needs to be sorted.
> >>
> >>  In the latter QList can be replaced with std::vector<std::unique_ptr<T>>
> >>  or QVector<std::unique_ptr<T>>
> >
> > At the price of user code uglification.
> 
> template<class T>
> using UniquePtrVector = std::vector<std::unique_ptr<T>>;

Leaves you with '->' vs '.' on things that effectively value semantics.

And you can't overload '.' to 'fix' this.

Andre'



More information about the Development mailing list