]> git.tdb.fi Git - libs/core.git/blobdiff - source/lexicalcast.h
Add specialization for lexical_cast<std::string> to avoid borking with spaces
[libs/core.git] / source / lexicalcast.h
index b1e9db89b622361b2cd9798e6830c8de8daf3b39..a2bb43953d43d764e24ff517d62e1ffd0052f6ee 100644 (file)
@@ -1,9 +1,16 @@
+/* $Id$
+
+This file is part of libmspstrings
+Copyright © 2006-2007 Mikko Rasa
+Distributed under the LGPL
+*/
+
 #ifndef MSP_STRINGS_LEXICALCAST_H_
 #define MSP_STRINGS_LEXICALCAST_H_
 
 #include <sstream>
 #include <string>
-#include <msp/error.h>
+#include <msp/core/except.h>
 #include "fmt.h"
 
 namespace Msp {
@@ -29,6 +36,12 @@ T lexical_cast(const std::string &s)
        return tmp;
 }
 
+template<>
+inline std::string lexical_cast<std::string>(const std::string &s)
+{
+       return s;
+}
+
 template<typename T>
 std::string lexical_cast(const T &v, const Fmt &f=Fmt())
 {