RFR: 8251274: Provide utility types for function SFINAE using extra template parameters

Kim Barrett kim.barrett at oracle.com
Thu Aug 27 08:37:36 UTC 2020


> On Aug 27, 2020, at 4:24 AM, Erik Österlund <erik.osterlund at oracle.com> wrote:
> 
> While I think having a legacy style that we are telling people not to use is unfortunate, I do understand that such a cleanup is a larger undertaking. So if the concern is that the identifier "EnableIf" is already taken today, then I think you can do what your previous example did: call the macro variant used inside of the template arguments ENABLE_IF instead, and have it take values only. Then we can transition away from using now "legacy" EnableIf gradually. And seeing as it is a macro, using capital letters is the natural name anyway.

I think there’s a misunderstanding here.

The failed (because of MSVC bugs) approach of an ENABLE_IF macro that accepts either a type
or a constexpr value is just not on the table.

What’s being proposed has zero macros; it’s all alias templates.
I considered having macros in order to eliminate the trailing “= 0”, but that benefit didn’t seem to
me to be worth (on it’s own) the issues that come with macros.  (And remember that I like macros.)




More information about the hotspot-dev mailing list