[Interest] move methods in QList

Roland Hughes roland at logikalsolutions.com
Tue Oct 10 17:56:12 CEST 2017


http://doc.qt.io/qt-5/qlist-members.html

  * *push_back <http://doc.qt.io/qt-5/qlist.html#push_back>*(const T &)
  * *push_front <http://doc.qt.io/qt-5/qlist.html#push_front>*(const T &)
  * *insert <http://doc.qt.io/qt-5/qlist.html#insert>*(int , const T &)
  * *insert <http://doc.qt.io/qt-5/qlist.html#insert-1>*(iterator ,
    const T &) : iterator
  * *move <http://doc.qt.io/qt-5/qlist.html#move>*(int , int )



On 10/10/2017 10:39 AM, interest-request at qt-project.org wrote:
>      I'm interested in storing a big structure in QList, and I would like to
>      move it to the list, but unlike std::list QList does not seem to have
>      push_back(T&&), insert(..., T&&) etc.
>      
>      Should I use std::list instead? Or use a QList of pointers (eg
>      QSharedPointer) to my structure? Or construct a default item and move my
>      new one over it, as in
>      
>      Big itemToAppend;
>      QList<Big> list;
>      list.append(Big());
>      list.last() = std::move(itemToAppend);
>      
>      Are there any plans to add the move methods to QList etc?

-- 
Roland Hughes, President
Logikal Solutions
(630)-205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog
http://lesedi.us/
http://onedollarcontentstore.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171010/99418939/attachment.html>


More information about the Interest mailing list