[SERVER-30044] BSONComparator should delete rvalue ref-qualified makeContainer() functions Created: 07/Jul/17  Updated: 30/Oct/23  Resolved: 23/Apr/20

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Kyle Suarez Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2020-05-04
Participants:

 Description   

It's very tempting to write

auto set = BSONElementComparator(BSONElementComparator::FieldNamesMode::kIgnore,
                                 stringDataBinaryComparator)
                   .makeBSONEltSet();

but this would be wrong, as the BSONElementComparator must outlive the container. We should delete the rvalue ref-qualified versions of these functions to stop code like this from compiling.



 Comments   
Comment by Githook User [ 23/Apr/20 ]

Author:

{'name': 'Drew Paroski', 'email': 'andrew.paroski@10gen.com'}

Message: SERVER-30044 Delete const&& versions of BSONComparatorInterfaceBase's make* methods
Branch: master
https://github.com/mongodb/mongo/commit/8981010cf5d5a2d529b338880186ed8f51526396

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