]> git.lyx.org Git - lyx.git/blobdiff - src/support/tostr.C
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / tostr.C
index a6dc3fac681d240075da4d9735c77731b3ecb464..d490413f849c261e7991b317df684d36c7acf09c 100644 (file)
@@ -4,16 +4,19 @@
  * Licence details can be found in the file COPYING.
  *
  * \author André Pönitz
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
-#include "support/std_sstream.h"
-#include "support/std_string.h"
 
-using std::ostringstream;
+#include <boost/lexical_cast.hpp>
+
+
+using boost::lexical_cast;
+
+using std::string;
 
 
 string const tostr(bool b)
@@ -24,33 +27,25 @@ string const tostr(bool b)
 
 string const tostr(unsigned int i)
 {
-       ostringstream os;
-       os << i;
-       return STRCONV(os.str());
+       return lexical_cast<string>(i);
 }
 
 
 string const tostr(long int i)
 {
-       ostringstream os;
-       os << i;
-       return STRCONV(os.str());
+       return lexical_cast<string>(i);
 }
 
 
 string const tostr(double d)
 {
-       ostringstream os;
-       os << d;
-       return STRCONV(os.str());
+       return lexical_cast<string>(d);
 }
 
 
 string const tostr(int i)
 {
-       ostringstream os;
-       os << i;
-       return STRCONV(os.str());
+       return lexical_cast<string>(i);
 }
 
 
@@ -58,4 +53,9 @@ string const tostr(string const & s)
 {
        return s;
 }
+
+
+string const tostr(long unsigned int i)
+{
+       return lexical_cast<string>(i);
+}