#include template constexpr T square(T x) { return x*x; } int main() { printf("%lf %d\n", square(3.4), square(3.4)); // 11.560000 9 }