Page 1 of 1

Std::istreambuf_iterator-Gleichheit bei Verwendung von searchg

Posted: 04 Jan 2025, 04:37
by Guest
Ich bin verwirrt über die Ausgabe des folgenden Codes:

Code: Select all

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