Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 32,796 of 33,346    |
|    fmatthew5876 to All    |
|    C++11 containers    |
|    14 Jan 13 23:26:10    |
   
   From: fmatthew5876@googlemail.com   
      
   { Reformatted; please limit your lines to 70 characters -mod }   
      
   With C++11 and perfect forwarding we can have functions like template   
    vector.emplace_back(Args&&... args) which forward   
   all of the constructor arguments.   
      
   This appears to work for all cases. If you want default construction   
   you pass no arguments, if you want copy or move you pass an lvalue or   
   rvalue T. If you want any other constructor, you pass the arguments   
   for it.   
      
   So my question is when creating our own containers for C++11 is there   
   any reason to still write old style insertion functions for a   
   container like void push_back(const T& t) or void push_back(T&& t)?   
      
      
   --   
    [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
    [ comp.lang.c++.moderated. First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca