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 .
|
patch
namespace is declared. So theto_string
in it will not be confused with theto_string
from other namespaces, since its fully qualified name ispatch::to_string
. - Harry