46 template <
class InType>
50 std::ostringstream oss;
51 oss.imbue(std::locale::classic());
66 template <
class OutType>
70 std::istringstream stream(s);
71 stream.imbue(std::locale::classic());
74 if (stream.fail() || !stream.eof())
76 throw std::runtime_error(
"Failed converting string to real number");
83 return toRealImpl<double>(s);
88 return toRealImpl<float>(s);
double toDouble(const std::string &s)
Converts a std::string to double using the classic C locale.
OutType toRealImpl(const std::string &s)
std::string toStringImpl(InType t)
float toFloat(const std::string &s)
Converts a std::string to float using the classic C locale.
locale-agnostic conversion functions from floating point numbers to strings
std::string toString(double d)
Convert a double to std::string using the classic C locale.
Main namespace for MoveIt!