Try removing using A::max and use the scope resolution operator on max. Also, In Visual C++ Express '10, the compiler complains about passing string literals instead of string objects. Also, the compiler doesn't like the fact that you aren't using c_str( ) when printing the result of max( )( due to you passing string literals ). However, when you pass string literals, your cannot return a object, because no string objects were passed.
Also, I don't understand why you're comparing strings that way.
In MSVC at least - the issue the OP is seeing is down to the inclusion of <string>
std::string is defined in the xstring header file, which includes <xmemory> which includes <xutility>. <xutility> throws a couple of min and max template functions into the std:: namespace.
I found the answer. Whenever you call a function, the C++ compiler looks for in the namespace you would expect (A here) but also in the namespaces of the arguments of the functions (std here). std has a max function so that is where conflict stems from.
It's called ADL -- Argument Dependent Lookup, also referred to as "Koenig Lookup".
Since you are passing std::strings to the function, ADL will consider the std namespace (because that's where string is declared). But it will also consider A since you explicitly told it to.