#include #include #include using namespace std; class Approx { public: int x; template::value, bool> = true> Approx(Integral i): x(i) {} template::value, bool> = true> Approx(Floating d): x(round(d)) {} }; int main() { Approx a1{3}, a2{5.7}; cout << a1.x << " " << a2.x << endl; }