#include <iostream>
#include <sstream>
#include <string>

template<typename T>
std::string to_string(const T& obj)
{
    std::ostringstream s;
    s << obj;
    return s.str();
}

struct MyType
{
    int x;
    double y;
    std::string name;
};

std::ostream& operator<<(std::ostream& ostream, const MyType& type)
{
    ostream << "x= " << type.x << '\n';
    ostream << "y= " << type.y << '\n';
    ostream << "name= " << type.name;
    return ostream;
}

int main(int argc, char* argv[])
{
    std::string temp = to_string(1) + " " + to_string(50.4) + "\n" + to_string(MyType { 10, 20, "Test"});
    
    std::cout << temp;
    return 0;
}