Is it allowed to overload operators, such as operator+ for a combination of a standard library type and a built-in type, when such an overload doesn't exist?
For example, is it legal to implement the following operator in the default namespace or a user-defined namespace:
std::string operator+(const std::string& s, int right) { ... }
I know there are various restrictions about implementing things in the std:: namespace, but it isn't clear to me if there is any rule against the above (whether it's a good idea is of course an entirely different matter!).