Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #85470
| From | Manfred <noname@add.invalid> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Do any STL inserters use std::move() by default? |
| Date | 2022-07-19 02:30 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <tb4u02$1ee2$1@gioia.aioe.org> (permalink) |
| References | <tb3vor$1foi$1@gioia.aioe.org> |
On 7/18/2022 5:55 PM, Muttley@dastardlyhq.com wrote: > Having to to call move() manually eg: v.push_back(std::move(str)) when you > need move functionality can become tedious. Are there any or will there be any > inserters that use move() by default? > If the argument is an rvalue, move semantics should be used per default whenever a method that accepts a rvalue reference is available. If it's a lvalue, and you want move semantics, you have to specify it with std::move(). This makes sense, since move semantics, in principle, modifies the argument.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Do any STL inserters use std::move() by default? Muttley@dastardlyhq.com - 2022-07-18 15:55 +0000
Re: Do any STL inserters use std::move() by default? Gawr Gura <gawrgura@mail.hololive.com> - 2022-07-18 10:25 -0700
Re: Do any STL inserters use std::move() by default? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-07-18 20:36 +0200
Re: Do any STL inserters use std::move() by default? Manfred <noname@add.invalid> - 2022-07-19 02:30 +0200
Re: Do any STL inserters use std::move() by default? Juha Nieminen <nospam@thanks.invalid> - 2022-07-19 07:24 +0000
csiph-web