--- trunk/src/utils/StringUtils.hpp 2012/08/22 02:28:28 1782 +++ trunk/src/utils/StringUtils.hpp 2014/12/11 21:18:03 2048 @@ -35,7 +35,7 @@ * * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). - * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ @@ -111,7 +111,7 @@ namespace OpenMD { /** * Convert a variable to a string - * @param T data type + * @tparam T data type * @param v data to be converted * @return a string */ @@ -146,6 +146,13 @@ namespace OpenMD { return ret; } + template + std::string to_string(T value) { + std::ostringstream os ; + os << value ; + return os.str() ; + } + bool isInteger(const std::string& str); std::string OpenMD_itoa(int value, unsigned int base = 10);