Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8290090

Change CodeBlobType from unscoped enum to enum class

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b10

      Change:
      struct CodeBlobType {
        enum { [...] }
      }
      To:
      enum class CodeBlobType {
        [...]
      };

      Using C++11 scoped enums provides a more clear view of intent, as enums can be enforced by the type system instead of being passed around as ints. While still providing the underlying int type through static_cast when it is needed. (Such as marshalling to Java or JFR serialisation)

            aboldtch Axel Boldt-Christmas
            aboldtch Axel Boldt-Christmas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: