Support separate function declaration and definition with ENABLE_IF-based SFINAE

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 17
    • Affects Version/s: 17
    • Component/s: hotspot
    • b07

      The ENABLE_IF macro provides convenient syntax for function template SFINAE using the new default template parameter feature of C++11. However, this macro can only be used in the function declaration (which may also be a definition).

      The syntax needed in a definition that is separate from the declaration is different, but the type forms for the non-type template parameters in the two places must be "equivalent" (C++14 14.5.6). The precise form for ENABLE_IF is "hidden" behind the macro. It is not desirable to have template definitions making assumptions about that form.

      This suggests there should be a second macro for use in the separate definition case, with the two macros maintained together to ensure the necessary consistency.

            Assignee:
            Kim Barrett
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: