[SERVER-57424] remove platform/bitwise_enum_operators.h Created: 03/Jun/21  Updated: 29/Oct/23  Resolved: 11/Jun/21

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

Type: Improvement Priority: Major - P3
Reporter: Billy Donahue Assignee: Billy Donahue
Resolution: Fixed Votes: 0
Labels: neweng, servicearch-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Service Arch 2021-06-14
Participants:

 Description   

This file exposes a macro ENABLE_BITMASK_OPERATORS that tries to give bitwise operators (&,|,,~,&=,|=,=) to enum types.

Unfortunately it always drops those operators in the `mongo` namespace, which isn't the right ADL namespace for arbitrary enum types that could be nested, private, or in a more specific or anonymous namespace.

Moreover, this macro is only used twice. Rather than fixing the macro (which might not be possible), it would be more cost-effective to remove the file and define operators as needed, manually.

One benefit of this header was to hide the noisy cast of an enum to its underlying type. This can be made much easier by polyfilling std::to_underlying(Enum v) (C++23) to stdx.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 10/Jun/21 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-57424 remove ENABLE_BITMASK_OPERATORS
Branch: master
https://github.com/mongodb/mongo/commit/2f464f96322d22a89c284ee6c0b213072f1a0345

Comment by Billy Donahue [ 08/Jun/21 ]

CR https://mongodbcr.appspot.com/798540018/

Generated at Thu Feb 08 05:41:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.