}
-/// Converts a variable of type \a T to a \c std::string by using a \c std::stringstream
+/// Converts a variable of type \a T to a \c std::string by using a \c boost::lexical_cast
template<class T>
std::string toString( const T& x ) {
return boost::lexical_cast<std::string>(x);
}
+/// Converts a variable of type std::string to \a T by using a \c boost::lexical_cast
+template<class T>
+T fromString( const std::string& x ) {
+ return boost::lexical_cast<T>(x);
+}
+
+
/// Writes a \c std::vector<> to a \c std::ostream
template<class T>
std::ostream& operator << (std::ostream& os, const std::vector<T> & x) {