This commit is contained in:
Erik Frojdh
2019-08-12 14:23:12 +02:00
parent c36dfc3992
commit 8e2494729b
6 changed files with 167 additions and 156 deletions

View File

@ -2,9 +2,9 @@
/**
* \file ToString.h
*
*
* Conversion from various types to std::string
*
*
*/
#include "TimeHelper.h"
@ -137,4 +137,11 @@ template <typename T> T StringTo(std::string t) {
return StringTo<T>(t, unit);
}
/** For types with a .str() method use this for conversion */
template <typename T>
typename std::enable_if<has_str<T>::value, std::string>::type
ToString(const T &obj) {
return obj.str();
}
} // namespace sls