#include struct I { using R = int; }; struct F { using R = float; }; class A { public: template static typename std::enable_if_t, I::R> f() { return 1; } template static typename std::enable_if_t, F::R> f() { return 27; } }; int main() { return A::f() + A::f(); }