2015-04-29 15:50:57 -04:00
|
|
|
#ifndef ISAAC_TOOLS_TO_STRING_HPP
|
|
|
|
#define ISAAC_TOOLS_TO_STRING_HPP
|
2014-08-30 18:02:17 -04:00
|
|
|
|
|
|
|
#include <string>
|
2015-01-19 21:29:47 -05:00
|
|
|
#include <sstream>
|
2014-08-30 18:02:17 -04:00
|
|
|
|
2015-04-29 15:50:57 -04:00
|
|
|
namespace isaac
|
2014-08-30 18:02:17 -04:00
|
|
|
{
|
|
|
|
namespace tools
|
|
|
|
{
|
|
|
|
|
|
|
|
template<class T>
|
|
|
|
inline std::string to_string ( T const t )
|
|
|
|
{
|
2015-08-06 20:20:08 -07:00
|
|
|
|
|
|
|
#ifdef _GLIBCXX_HAVE_BROKEN_VSWPRINTF
|
2014-08-30 18:02:17 -04:00
|
|
|
std::stringstream ss;
|
|
|
|
ss << t;
|
|
|
|
return ss.str();
|
2015-08-06 20:20:08 -07:00
|
|
|
#else
|
|
|
|
return std::to_string(t);
|
|
|
|
#endif
|
2014-08-30 18:02:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|