Можно ли использовать rdbuf()->in_avail(), чтобы проверить, были ли данные напечатаны в строковом потоке? ⇐ C++
-
Anonymous
Можно ли использовать rdbuf()->in_avail(), чтобы проверить, были ли данные напечатаны в строковом потоке?
In my code base there is code like the example below. A stringstream is used to collect output and later, if there have been things written to the stream these things are written to another stream. To check if there are things on the collecting stream the code uses rdbuf()->in_avail(). Is this well defined, and has the expected behavior changed between C++17 and C++20?
#include #include int main() { std::stringstream ss; ss.str(""); ss in_avail()) std::cout
Источник: https://stackoverflow.com/questions/781 ... ed-on-stri
In my code base there is code like the example below. A stringstream is used to collect output and later, if there have been things written to the stream these things are written to another stream. To check if there are things on the collecting stream the code uses rdbuf()->in_avail(). Is this well defined, and has the expected behavior changed between C++17 and C++20?
#include #include int main() { std::stringstream ss; ss.str(""); ss in_avail()) std::cout
Источник: https://stackoverflow.com/questions/781 ... ed-on-stri
Мобильная версия