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,092 of 33,346    |
|    Kaba to Dave Abrahams    |
|    Re: Implicit move of an lvalue    |
|    04 Apr 12 12:04:14    |
   
   From: kaba@nowhere.com   
      
   This same post also addresses the replies of Daniel Krügler, SG, and   
   Martin B., to avoid repeating things.   
      
   Dave Abrahams wrote:   
   > You're complaining that an lvalue ("that") passed through std::move   
   > will bind silently to an rvalue reference, but I don't understand why   
   > that's a problem for you.   
      
   Well, that was not the problem. The 'problem' is that Type&& binds to a   
   reference. The non-template function disallows it, while an innocent-   
   looking generalization (by a template function) to an arbitrary type   
   allows it.   
      
   > After all, std::move(x) *means*: "I grant   
   > explicit permission to move from x, even if it's an lvalue." If you   
   > want to move only when the argument to f is an rvalue, then you write:   
   >   
   > A b(std::forward
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca