-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
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.
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.
- relates to
-
JDK-8251274 Provide utilities for function SFINAE using extra template parameters
- Resolved