Newsgroup: comp.lang.c++
Subject: Move rules
From: woodbrian77@...
Date: Wed, 6 Nov 2013 09:02:52 -0800 (PST)
I recall reading a month or so ago about how the standard
allows compilers to move an object that's about to go
out of scope. So iirc it wouldn't be necessary to use
std::move in that case. Now I'm not able to find anything
about that. Links please. And what compilers have
support for that?
I have some code like this
{
A a;
...
vec.emplace_back(::std::move(a));
}
With clang 3.3 and gcc 4.8.1 my executable is smaller with
the std;;move than if I take that out. Does that mean that
those compilers aren't making that optimization? Tia.
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
Subject: Move rules
From: woodbrian77@...
Date: Wed, 6 Nov 2013 09:02:52 -0800 (PST)
I recall reading a month or so ago about how the standard
allows compilers to move an object that's about to go
out of scope. So iirc it wouldn't be necessary to use
std::move in that case. Now I'm not able to find anything
about that. Links please. And what compilers have
support for that?
I have some code like this
{
A a;
...
vec.emplace_back(::std::move(a));
}
With clang 3.3 and gcc 4.8.1 my executable is smaller with
the std;;move than if I take that out. Does that mean that
those compilers aren't making that optimization? Tia.
Brian
Ebenezer Enterprises - In G-d we trust.
http://webEbenezer.net
via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?123100-Move-rules&goto=newpost
View all the progranning help forums at:
http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums
No comments:
Post a Comment