[SERVER-82900] Remove variant.h and stdx::variant alias Created: 07/Nov/23  Updated: 05/Dec/23  Resolved: 05/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: David Percy Assignee: Vinod Kumar
Resolution: Fixed Votes: 0
Labels: techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-41414 Have stdx::variant unconditionally im... Closed
related to SERVER-77009 Remove mpark variant library from thi... Closed
Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2023-11-13, Service Arch 2023-11-27, Service Arch 2023-12-11
Participants:

 Description   

Our ::mongo::stdx::variant type used to be a conditional alias, to support different platforms. But as of SERVER-41414 it was no longer conditional, and as of SERVER-77009, it's always std::variant.

Now that ::mongo::stdx::variant and std::variant are always the same, it means code that incorrectly mixes std::variant with ::mongo::stdx::get or vice versa will not be caught in any build variant. So the alias is no longer giving us the benefit of easily switching implementations.

Lets remove the alias and find-replace everything to use std::variant directly.



 Comments   
Comment by Vinod Kumar [ 05/Dec/23 ]

Switched to std::variant

Comment by Githook User [ 03/Dec/23 ]

Author:

{'name': 'Vinod Kumar', 'email': 'vinod.kumar@mongodb.com', 'username': 'vkumar-mdb'}

Message: SERVER-82900 Removed mongo/stdx/variant.h and switched to std::variant

GitOrigin-RevId: 2aa03564ad22ec0b4a3517924ec2cec3bfb2e208
Branch: master
https://github.com/mongodb/mongo/commit/0b1beeea95dc5aecb5ac3ac20940f525febdd9c5

Comment by Billy Donahue [ 07/Nov/23 ]

I agree. I think we should either force all code to use the stdx names or force all code to not use it.

My preference would be to force all code to not use it.

Generated at Thu Feb 08 06:50:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.