This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: finding about move vs copy in C++


On Wed, 31 Dec 2014 09:18:35 pm Jonathan Wakely wrote:
> What exactly are you worried about, the compiler failing to perform
> moves, or your code missing opportunities to move?
> 
> The former will very rarely be a problem, the latter can be solved by
> understanding the language better.
> 
Well there's the rub. When there may or may not be an automatically generated 
move assignment or constructor and the compiler may or may not choose a move 
based on the risk of an exception being thrown and with the return value 
optimisation etc it's rather difficult to predict exactly what will happen.

Since this is a static decision it would be nice if the compiler could tell 
me. Otherwise I have to step through it in gdb to find out what method it is 
using.
-- 
Anthony Shipman                    Mamas don't let your babies 
als@iinet.net.au                   grow up to be outsourced.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]