/* * toString.hpp * * Created on: Nov 14, 2010 * Author: heber */ #ifndef TOSTRING_HPP_ #define TOSTRING_HPP_ #include #include #include /** Converter for any class to string. * We use default conversion via stringstream as suggested by [Stroustrup]. * \param _&_object reference to object to convert to string. * \return string converted \a _object */ template std::string toString(T const &_object) { std::stringstream s; s << _object; return s.str(); } #endif /* TOSTRING_HPP_ */