class myclass {
private:
const myenum value;
public:
enum myenum { first, second }
myclass(myenum value) : value(value) {}
template < /* enable if myclass::value == myclass::myenum::first */ >
void myfunc();
template < /* enable if myclass::value == myclass::myenum::second */ >
void myfunc();
}
int main(){
myclass instance(myclass::myenum::first);
instance.myfunc();
}
value
is mode at witch myfunc()
operates if you will. So far all my attempts have failed. Please tell whether it is possible to achieve the desired behavior and give me your suggestions