小さなパーサーをコーディングしているときにこの問題に遭遇し、スペース文字に遭遇した後、stringstream がそれ以上データを受信しないように見えることに気付きました。
基本的
std::stringstream stream;
stream << "Test test";
std::string str;
stream >> str;
std::cout << str;
"Test test" の代わりに "Test" を出力します。これを回避する方法はありますか?
小さなパーサーをコーディングしているときにこの問題に遭遇し、スペース文字に遭遇した後、stringstream がそれ以上データを受信しないように見えることに気付きました。
基本的
std::stringstream stream;
stream << "Test test";
std::string str;
stream >> str;
std::cout << str;
"Test test" の代わりに "Test" を出力します。これを回避する方法はありますか?