namespace patch { template < typename T > std::string to_string( const T& n )//??? { std::ostringstream stm ;//??? stm << n ; return stm.str() ; } } 
  • 3
    The patch namespace is declared. So the to_string in it will not be confused with the to_string from other namespaces, since its fully qualified name is patch::to_string . - Harry
  • one
    The question sounds like "what is a Volkswagen used for?" The question is not clear. - AnT

1 answer 1

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 .