4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
12 * A collection of string helper functions that works with string.
13 * Some of these would certainly benefit from a rewrite/optimization.
19 #include <boost/static_assert.hpp>
25 // Commented out since BOOST_STATIC_ASSERT does not work with gcc 4.0
26 template <class Target, class Source>
27 Target convert(Source arg)
29 // We use a static assert here since we want all instances of
30 // this template to be specializations.
31 BOOST_STATIC_ASSERT(sizeof(bool) == 0);
35 template <class Target, class Source>
36 Target convert(Source arg);
41 std::string convert<std::string>(bool);
44 std::string convert<std::string>(char);
47 std::string convert<std::string>(unsigned short);
50 std::string convert<std::string>(int);
53 std::string convert<std::string>(unsigned int);
56 std::string convert<std::string>(float);
59 std::string convert<std::string>(double);
62 std::string convert<std::string>(std::string);