Using function return for another template function C++

Viewed 56

I am trying to call a templated function using the return of another function, but I cannot seem to get it working.

enum class MYENUM {
    X1,X2
};

MYENUM SomeFunc() {
    return MYENUM::X1;
}

template<MYENUM T>
void ENUMFunc() {
    //do something
}

int main() {
    ENUMFunc<MYENUM::X1>(); //works
    ENUMFunc<SomeFunc()>(); //error?
}
1 Answers
Related