Код: Выделить всё
std::string content = "abcdefghijklmnopqrstuvwxyz1234567890";
std::istringstream iss(content);
iss.seekg(10);
std::istreambuf_iterator it{iss}, end;
EXPECT_TRUE(iss.good());
iss.seekg(35);
std::istreambuf_iterator it2{iss};
EXPECT_TRUE(iss.good());
iss.seekg(0);
std::istreambuf_iterator it3{iss};
EXPECT_TRUE(iss.good());
bool oneAndTwo = it == it2;
bool twoAndThree = it2 == it3;
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79327652/stdistreambuf-iterator-equality-when-using-seekg[/url]