Skip to content

✨ Add byterator #115

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

Merged
merged 1 commit into from
Jun 25, 2024
Merged

✨ Add byterator #115

merged 1 commit into from
Jun 25, 2024

Conversation

elbeno
Copy link
Contributor

@elbeno elbeno commented Jun 25, 2024

Problem:

  • It is a common case to have a table of <unsigned words> from which we want to read <arbitrary-size unsigned quantity> as we interpret the table. For example, an array of std::uint32_t where we read some things as 16-bit, some things as 8-bit, etc.

Solution:

  • Add byterator - an iterator-like type that allows extra read/write operations. It behaves like a random access iterator (to std::byte) but also has operations to peek, read and write arbitrary trivially-copyable types.

Problem:
- It is a common case to have a table of <unsigned words> from which we want to
  read <arbitrary-size unsigned quantity> as we interpret the table. For
  example, an array of std::uint32_t where we read some things as 16-bit, some
  things as 8-bit, etc.

Solution:
- Add `byterator` - an iterator-like type that allows extra read/write
  operations. It behaves like a random access iterator (to `std::byte`) but also
  has operations to peek, read and write arbitrary trivially-copyable types.
Copy link
Contributor

@lukevalenty lukevalenty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@lukevalenty lukevalenty merged commit 61e0512 into intel:main Jun 25, 2024
31 checks passed
@elbeno elbeno deleted the byterator branch June 25, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants