10 lines
219 B
C++
10 lines
219 B
C++
#include <sstream>
|
|
#include <string>
|
|
|
|
// Template function to convert an object to a string
|
|
template <typename T>
|
|
std::string toString(const T& obj) {
|
|
std::ostringstream oss;
|
|
oss << obj;
|
|
return oss.str();
|
|
}
|