diff options
-rw-r--r-- | tools.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -3,6 +3,7 @@ #include <ctime> #include <istream> +#include <locale> #include <ostream> #include <sstream> #include <stdexcept> @@ -54,6 +55,15 @@ To lexical_cast( From const& from ) return result; } +template< typename From > +std::string ConvertToString( From const& from, std::locale const& loc = std::locale() ) +{ + std::ostringstream parser; + parser.imbue( loc ); + parser << from; + return parser.str(); +} + class ReadLock { public: |