by Guest » 04 Jan 2025, 04:37
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
Ich bin verwirrt über die Ausgabe des folgenden Codes:
[code]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