[Pitch] Safe loading of integer values from `RawSpan`

I have started a second pitch thread, after having significantly reworked the proposal.

3 Likes

In terms of what the OS will accept, true. In terms of a non-trapping (in C parlance) bit pattern, any will do.

(I think we're perhaps talking past each other.)

(I think we're perhaps talking past each other.)

Indeed; “fully inhabited” in the sense Guillaume has been using it here does not mean “does not have a trap representation” (in C standardese), but rather “loading an arbitrary sequence of bytes interpreted as T and then using it cannot violate program invariants and result in UB.”

5 Likes

Understood! Sorry for derailing the conversation—I think we need to be clear in our terminology here (see my previous reply to @John_McCall) but I get that we're not talking about "inhabited" the same way we do when e.g. filling out enum bits.

I'll go back to the… cave… that I inhabit. :drum:

2 Likes