X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fconvert.h;h=c1cd31551a8e46b48ab89474ef4d2109c1f7c21d;hb=f1ab5dfc5878bc736fd185279a0ef7a185b2d8d8;hp=22d5f12a8b97d9f0e2dca95f2911e9af2c0cc95e;hpb=7ab15b2e0c7592d6ddd7b8f6be69855a802f9d3e;p=lyx.git diff --git a/src/support/convert.h b/src/support/convert.h index 22d5f12a8b..c1cd31551a 100644 --- a/src/support/convert.h +++ b/src/support/convert.h @@ -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. * @@ -16,49 +16,35 @@ #ifndef CONVERT_H #define CONVERT_H -#include +#include "support/strfwd.h" -#include +namespace lyx { - -#if 0 -// Commented out since BOOST_STATIC_ASSERT does not work with gcc 4.0 -template -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 Target convert(Source arg); -#endif - - -template<> -std::string convert(bool); - -template<> -std::string convert(char); - -template<> -std::string convert(unsigned short); - -template<> -std::string convert(int); - -template<> -std::string convert(unsigned int); - -template<> -std::string convert(float); -template<> -std::string convert(double); -template<> -std::string convert(std::string); +template<> std::string convert(bool b); +template<> std::string convert(char c); +template<> std::string convert(short unsigned int sui); +template<> std::string convert(int i); +template<> docstring convert(int i); +template<> std::string convert(unsigned int ui); +template<> docstring convert(unsigned int ui); +template<> std::string convert(unsigned long ul); +template<> docstring convert(unsigned long ul); +template<> std::string convert(long l); +template<> docstring convert(long l); +template<> std::string convert(float f); +template<> std::string convert(double d); +template<> int convert(std::string const s); +template<> int convert(docstring const s); +template<> unsigned int convert(std::string const s); +template<> unsigned long convert(std::string const s); +template<> double convert(std::string const s); +template<> int convert(char const * cptr); +template<> double convert(char const * cptr); + +} // namespace lyx #endif