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

Remove unnecessary template parameter lists in GrowableArray

XMLWordPrintable

    • b17

        There are several places in the GrowableArray code where explicit template parameter lists are used unnecessarily. In the future, some of those uses may become syntactically invalid (*).

        Within the definition scope of a class template, the identifier for that template can be used without any template parameters. Only if some other set of parameters is needed do the parameters need to be explicit.

        For example, comparing this with an object of the same type doesn't need to provide template parameters for the parameter type. It's even a little bit beneficial to not do so, since renaming a template parameter requires fewer ancillary changes.

        (*) There are several cases where a constructor declaration has a template parameter list. This isn't currently needed, and seems to not even be valid syntax in later C++ versions. (I discovered this while experimenting with using -std:c++20.)

              kbarrett Kim Barrett
              kbarrett Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: