sfinae

Using enum values in combination with SFINAE

我的梦境 提交于 2020-12-05 19:17:15
问题 I am already familiar with SFINAE and how it can be used to enable specific templates based on the passed type (by using std::enable_if). However I have recently started working on a project where I'd like to do the following: create a class specialization based on the provided enum VALUE while using SFINAE. Now, I know that it's possible to make specializations based on an enum value considering I've done this before (like so): enum Specifier { One, Two, Three } template <Specifier> class

Using enum values in combination with SFINAE

放肆的年华 提交于 2020-12-05 19:15:33
问题 I am already familiar with SFINAE and how it can be used to enable specific templates based on the passed type (by using std::enable_if). However I have recently started working on a project where I'd like to do the following: create a class specialization based on the provided enum VALUE while using SFINAE. Now, I know that it's possible to make specializations based on an enum value considering I've done this before (like so): enum Specifier { One, Two, Three } template <Specifier> class