[SERVER-23758] Non CLang compliant use of std::move Created: 15/Apr/16  Updated: 26/Apr/16  Resolved: 18/Apr/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.3.5

Type: Bug Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Misha Tyulenev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-23727 pessimizing moves Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 13 (04/22/16)
Participants:

 Description   

the std::move of returned objects can prevent copy elision hence should be avoided. While unique_ptr does not have lvalues copy c-tor the return value from function is an rvalue so the move c-tor can be used.



 Comments   
Comment by Githook User [ 18/Apr/16 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-23758 do not use std::move when it can disable copy elision
Branch: master
https://github.com/mongodb/mongo/commit/9fb10c2bbf11cb4f38a98377ba7ab48d3554ff56

Generated at Thu Feb 08 04:04:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.