This is the mail archive of the gcc-bugs@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]

[Bug libstdc++/60966] std::call_once sometime hangs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60966

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> > N.B. the std::move in Manager::cancelConnection is redundant, the return
> > value from cancel_connection is already an rvalue.
> 
> Yes, I know, the problem is I have some hard time to avoid doing this as it
> is more for me and what I expect the compiler to do or the semantics I want
> the code to have :)

OK, but it makes the code worse. Here the compiler will elide the move
constructor (aka return value optimisation):

  auto future = cancel_connection(c);

Whereas here the compiler cannot do that and must call a move constructor:

  auto future = std::move(cancel_connection(c));


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