]> git.lyx.org Git - lyx.git/blobdiff - src/support/convert.h
More requires --> required, for C++2a.
[lyx.git] / src / support / convert.h
index 22d5f12a8b97d9f0e2dca95f2911e9af2c0cc95e..3b97fb6c88799fe04f486637fdb849811d378863 100644 (file)
@@ -4,8 +4,8 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
- * \author Lars Gullik Bjønnes
+ * \author André Pönitz
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  *
 #ifndef CONVERT_H
 #define CONVERT_H
 
-#include <boost/static_assert.hpp>
+#include "support/strfwd.h"
 
-#include <string>
+namespace lyx {
 
-
-#if 0
-// Commented out since BOOST_STATIC_ASSERT does not work with gcc 4.0
-template <class Target, class Source>
-Target convert(Source arg)
-{
-       // We use a static assert here since we want all instances of
-       // this template to be specializations.
-       BOOST_STATIC_ASSERT(sizeof(bool) == 0);
-       return Target();
-}
-#else
 template <class Target, class Source>
 Target convert(Source arg);
-#endif
-
-
-template<>
-std::string convert<std::string>(bool);
-
-template<>
-std::string convert<std::string>(char);
 
-template<>
-std::string convert<std::string>(unsigned short);
 
-template<>
-std::string convert<std::string>(int);
-
-template<>
-std::string convert<std::string>(unsigned int);
-
-template<>
-std::string convert<std::string>(float);
-
-template<>
-std::string convert<std::string>(double);
-
-template<>
-std::string convert<std::string>(std::string);
+template<> std::string convert<std::string>(bool b);
+template<> std::string convert<std::string>(char c);
+template<> std::string convert<std::string>(short unsigned int sui);
+template<> std::string convert<std::string>(int i);
+template<> docstring convert<docstring>(int i);
+template<> std::string convert<std::string>(unsigned int ui);
+template<> docstring convert<docstring>(unsigned int ui);
+template<> std::string convert<std::string>(unsigned long ul);
+template<> docstring convert<docstring>(unsigned long ul);
+#ifdef HAVE_LONG_LONG_INT
+template<> std::string convert<std::string>(unsigned long long ull);
+template<> docstring convert<docstring>(unsigned long long ull);
+#endif
+template<> std::string convert<std::string>(long l);
+template<> docstring convert<docstring>(long l);
+#ifdef HAVE_LONG_LONG_INT
+template<> std::string convert<std::string>(long long ll);
+template<> docstring convert<docstring>(long long ll);
+#endif
+template<> std::string convert<std::string>(float f);
+template<> std::string convert<std::string>(double d);
+template<> int convert<int>(std::string const & s);
+template<> int convert<int>(docstring const & s);
+template<> unsigned int convert<unsigned int>(std::string const & s);
+template<> unsigned long convert<unsigned long>(std::string const & s);
+template<> double convert<double>(std::string const & s);
+template<> int convert<int>(char const * cptr);
+template<> double convert<double>(char const * cptr);
+
+} // namespace lyx
 
 #endif