Std::istreambuf_iterator-Gleichheit bei Verwendung von searchg

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Std::istreambuf_iterator-Gleichheit bei Verwendung von searchg

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

Top