#include #include //1 template decltype(std::declval().fun()) value() { return 12.5; } //= //2 struct Integral { int fun() const; // implementation not required }; struct Real { double fun() const; // same. }; int main() { std::cout << value() << ' ' << value() << '\n'; } //=