Make names from the math namespace available locally */ Note: text uses hypot(), but this causes ambiguities with hypot() function of with Visual Studio
| 7 | // Note: text uses hypot(), but this causes ambiguities with hypot() |
| 8 | // function of <cmath> with Visual Studio |
| 9 | auto hypotenuse(const auto& x, const auto& y) |
| 10 | { |
| 11 | using namespace math; |
| 12 | // Or: |
| 13 | // using math::square; |
| 14 | // using math::sqrt; /* Same as, of course: using std::sqrt; */ |
| 15 | return sqrt(square(x) + square(y)); |
| 16 | } |
| 17 | |
| 18 | int main() |
| 19 | { |