Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57424

remove platform/bitwise_enum_operators.h

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0-rc0
    • Component/s: None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Service Arch 2021-06-14

      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.

        Attachments

          Activity

            People

            Assignee:
            billy.donahue Billy Donahue
            Reporter:
            billy.donahue Billy Donahue
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: