]> git.stg.codes - stg.git/blobdiff - stglibs/common.lib/include/stg/common.h
Added specialization of str2x for doubles.
[stg.git] / stglibs / common.lib / include / stg / common.h
index ddc69def4d503f4d57e310b5adfc9bbca6ddcf3b..af0f89a181c66dafd477356a5429f6baf148d7e2 100644 (file)
@@ -152,6 +152,7 @@ std::string ToPrintable(const std::string & src);
 //-----------------------------------------------------------------------------
 int str2x(const std::string & str, int32_t & x);
 int str2x(const std::string & str, uint32_t & x);
+int str2x(const std::string & str, double & x);
 #ifndef WIN32
 int str2x(const std::string & str, int64_t & x);
 int str2x(const std::string & str, uint64_t & x);
@@ -168,11 +169,11 @@ int str2x(const std::string & str, varT & x);
 template <typename varT>
 const std::string & x2str(varT x, std::string & s);
 template <typename varT>
-const std::string & x2str(varT x) { std::string s; return x2str(x, s); }
+std::string x2str(varT x) { std::string s; return x2str(x, s); }
 template <typename varT>
 const std::string & unsigned2str(varT x, std::string & s);
 template <typename varT>
-const std::string & unsigned2str(varT x) { std::string s; return unsigned2str(x, s); }
+std::string unsigned2str(varT x) { std::string s; return unsigned2str(x, s); }
 
 //-----------------------------------------------------------------------------
 template <typename varT>