-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
define a container for reading bytes from a file #117
base: master
Are you sure you want to change the base?
Conversation
Define a default constructor for `bit_span`. Update `consume` to return a reference. Change-Id: I08edcc3e240a44a04b09a8ba787030665134f3a8
Change-Id: I5dca691416482ae27ab31bc176fd5217b8e3fd8f
Define a `byte_container` class template for use in tests. It provides `std::byte`-oriented access (as opposed to `char`) to the bytes in a file or string. Change-Id: I364fcb0efaae9ac79bb78198912b885b3d9f54c5
f67d366
to
4786297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is more type safe because of static_cast rather than reinterpret_cast?
But it is a lot of code, and I think has an extra copy (vs the reinterpet_cast).
If that's right I'm inclined to stick with reinterpret_cast, or just switch everything from byte to uint8_t. I know byte is conceptually what we want, but it seems like it interacts with the file I/O library badly and I don't really see any downside to using uint8_t.
Thoughts?
I don't think There's an extra copy for the
|
b15303a
to
0803a3a
Compare
Define a
byte_container
class template for use in tests. It providesstd::byte
-oriented access (as opposed tochar
) to the bytes in afile or string.
Change-Id: I364fcb0efaae9ac79bb78198912b885b3d9f54c5