namespace patch { template < typename T > std::string to_string( const T& n )//??? { std::ostringstream stm ;//??? stm << n ; return stm.str() ; } } 1 answer
In order to write path::to_string in client code, thus calling this version would clearly differ from standard std::to_string .
I can assume that the author tried to use overloads of the std::ostream & operator << (...) inside to_string , since the standard version prints a very limited set of types .
|
patchnamespace is declared. So theto_stringin it will not be confused with theto_stringfrom other namespaces, since its fully qualified name ispatch::to_string. - Harry