summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools.h b/tools.h
index 6b122b0..63450f1 100644
--- a/tools.h
+++ b/tools.h
@@ -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: