Skip to content
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

⚡ Feature: Buffer views #22

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open

⚡ Feature: Buffer views #22

wants to merge 36 commits into from

Conversation

deavmi
Copy link
Owner

@deavmi deavmi commented Apr 30, 2024

Purpose ✍️

Implement views.

Todo

  • Update README.md
  • Documentation
  • Implementation
  • Testing

- Initial work-in-progress for a new `View` type-buffer
- Fixed incorrect assertion
- Implemented `opSlice()`

View (unittests)

- Added test for `opSlice()`
@deavmi deavmi added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 30, 2024
@deavmi deavmi self-assigned this Apr 30, 2024
- Added test for out-of-bounds indexing
- Added support for the `~=` operator overload

View (unittests)

- Use the operator overload
- Allow updating indices
- More work being done on deciding various parts of this API
- Fixed the `opIndexAssign(...)`
- made `opIndex(size_t)` and `opIndexAssign(T, size_t)` respect the "fake" size

View (unittests)

- Added code to test the above updates to the `View` type
- Made `add(T[])` private
- Added range `opSlice()`
- Fixed range-based `opSlice(...)`

View (unittests)

- Added unittest
- New, more efficient `opSlice(size_t, size_t)` implemented

View (unittests)

- Updated slicing tests
- Typo fix
- Added another test to test the last )untested) branch of the `opSlice(size_t, size_t)` method
- Added more tests for `opSlice(size_t, size_t)`
- `opSlice()` now forwards to `opSlice(size_t, size_t)`
- Only add debug in unittest mode
- Cleaned up
- Cleaned up
- When calling `opSlice(size_t, size_t)` with arguments that are equal then you should return `[]`. This fixe a bug when we do `view[]` and length was `0` as `opSlice()` calls `opSlice(size_t, size_t)` with `opSlice(0, 0) then
- Removed unreachable code
- Removed unreachable code
- Replaced unreachable code with a false assertion
- Cleaned up
- Cleaned up
- Working on type definition
deavmi added 9 commits May 2, 2024 15:49
- More compile-time checks added
- More compile-time checks added
- More compile-time checks added
- More compile-time checks added
- Added docs
- Cleaned up
- `add(T[])` was constructing TWO `SectorType` instances, make it only one
- Added graphing back
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant