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

remove platform/bitwise_enum_operators.h

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • 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

            billy.donahue@mongodb.com Billy Donahue
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: