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

Use auto variable declarations for enum iteration

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b03

      Description

      The pattern used in JDK-8257912

        for (vmIntrinsicID index : EnumRange<vmIntrinsicID>{}) {
          nt[as_int(index)] = string;
        }

      can be further simplified to the following without loss of readability, since the type of index would be obviously the type enclosed by EnumRange<>

        for (auto index : EnumRange<vmIntrinsicID>{}) {
          nt[as_int(index)] = string;
        }

      (as suggested by John Rose)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: