int main() {
SimpleStringOwner x{ "x" };
printf("x is alive\n");
}
...will print "Constructed: x" (etc) but it actually won't.
It will instead print "Constructed: : x" (etc) due to the contents of the source code on pages 108 and 110.
The original SimpleString code already adds a colon and a space to tags for its tagged print function, but the later code is designed as if this wasn't the case. These two sections of the book are probably from different revisions of the book that were created during its writing.
Here's the original print function from SimpleString:
Page 111 claims that this code:
...will print "Constructed: x" (etc) but it actually won't.
It will instead print "Constructed: : x" (etc) due to the contents of the source code on pages 108 and 110.
The original SimpleString code already adds a colon and a space to tags for its tagged print function, but the later code is designed as if this wasn't the case. These two sections of the book are probably from different revisions of the book that were created during its writing.
Here's the original print function from SimpleString:
...and here's how it is used later:
string.print("Constructed: ");
(etc)
Notice the implications of that.
The text was updated successfully, but these errors were encountered: