Is it a good practice to overload math functions in namespace std in c++
问题 I am writing a C++ class which represents an arithmetic type (a c++ wrapper around mpfr), and I'd like to support some functions found in <cmath> (I'll take std::sqrt as an example). So I have the following class: namespace ns { class MyClass { /* ... */ public: friend MyClass sqrt(const MyClass& mc); }; } And I can use it this way: MyClass c; /* ... */ MyClass d = ns::sqrt(c); MyClass e = sqrt(c); // Apparently I don't have to specify ns:: But I cannot use it this way: MyClass f = std::sqrt