Paul Backus

Results 131 comments of Paul Backus

> What about adding a copy constructor that hollows out the original? Seems like this could break code that currently works (e.g., anything that makes a copy and then calls...

> even if you don't hollow it out, what about removing the character to put back so it's not put back twice? Isn't that functionally the same as hollowing it...

Actually never mind, `LockingTextReader` is `public`, which means we absolutely cannot assume that code using it follows input range best practices and only ever uses one instance at a time....

Attempted the hollow-out approach anyway and it turns out that replacing `LockingTextReader`'s postblit with a copy ctor is not going to be an option—it requires doing the same to `File`,...

The problem with that suggestion is that it calls `ungetc` on the destruction of the *first* instance, not the *last* instance. Which means that if you copy the reader while...

Type punning with a union is *not* undefined behavior in C. See [this footnote][1] from the C11 standard: > If the member used to read the contents of a union...

@PetarKirov It seems to me like the kind code that broke in the linked PR—where a user relies on overload resolution to choose between a Phobos function and their own...

You need to document both the outer template and the inner function.

Just leaving the tuple members default-initialized when there's nothing to read is not good enough, because it gives the user no way to distinguish between a default value read from...

Another option is to throw an exception—iirc this is what `slurp` does.