I would like to have a class which disables/enables member functions based on the value of a template parameter to a class. I have the following:
enum MyType{ type1, type2 };
template <MyType type>
class Test{
public:
enum TestTraits{ testType = type };
template <typename T>
constexpr bool func(SomethingElse<T> else)
{
if(testType == type1) return false;
// some logic that would return true or false
}
};
I would basically like to make it a compile time check instead of a runtime check, and that its not even an option for the client to call it if possible. I'm sure the solution is enable_if, but when I see that, it seems like it requires the enable_if to decide the return type or one of the function parameters