// File: const3.cpp // // ANSI C++ standard says const and & are // not supposed to resolve overloading, // for a good reason! #include using namespace std ; double AddOne(double x) { cout << "First one" << endl ; return x + 1 ; } double AddOne(const double& x) { cout << "Second one" << endl ; return x + 1 ; } int main() { double x = 6, y ; y = AddOne(x) ; cout << y << endl ; }