#include <iostream>
#include <string>
#include <sstream>
template<typename T>
T from_string(const std::string &str)
{
std::stringstream ss(str);
T t;
ss >> t;
return t;
}
/*
template<>
std::string from_string(const std::string &str)
{
return str;
}
*/
int main()
{
auto x = from_string<std::string>("1 2");
std::cout << x; // Вывод "1" вместо "1 2"
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KCnRlbXBsYXRlPHR5cGVuYW1lIFQ+ClQgZnJvbV9zdHJpbmcoY29uc3Qgc3RkOjpzdHJpbmcgJnN0cikKeyAgIAogICAgc3RkOjpzdHJpbmdzdHJlYW0gc3Moc3RyKTsKICAgIFQgdDsKICAgIHNzID4+IHQ7CiAgICByZXR1cm4gdDsKfQoKLyoKdGVtcGxhdGU8PgpzdGQ6OnN0cmluZyBmcm9tX3N0cmluZyhjb25zdCBzdGQ6OnN0cmluZyAmc3RyKQp7ICAgCiAgICByZXR1cm4gc3RyOwp9CiovCgppbnQgbWFpbigpCnsKCWF1dG8geCA9IGZyb21fc3RyaW5nPHN0ZDo6c3RyaW5nPigiMSAyIik7CglzdGQ6OmNvdXQgPDwgeDsgLy8g0JLRi9Cy0L7QtCAiMSIg0LLQvNC10YHRgtC+ICIxIDIiCgkKCXJldHVybiAwOwp9