-
Notifications
You must be signed in to change notification settings - Fork 5
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
MemoryBuffer <: AbstractVector #14
Comments
@brenhinkeller might've wanted something this, too. |
It probably makes more sense for it to be array like so that we don't have to worry about complications due to indexing with other collections. But basic iteration and |
Seems like it could be handy! |
I do fear that adding indexing methods would encourage/steer people towards less flexible and less convenient APIs for whatever they're using it for. Anyone using this should write their structs and method implementations around This will be easy to do if they make their code based on I think we should aim to encourage the former. |
Oh, so this may explain one of the cases where I thought I had a StaticCompiler error that went away when I added an extra |
Back on topic, there is one case that comes to mind where it would be very useful to have |
Here's one case
so in this example a relatively minor QoL point about being able to get |
Hmm, that makes sense I guess. |
I suppose more documentation of "You don't want MemoryBuffer directly if you want an array, use (...) instead" could help avoid the possible side-effects; I could probably PR some if y'all like |
PRs welcome. |
I'll see what I can do after I catch up on some non-coding work |
Should we have
MemoryBuffer
be a vector or maybe act vector like, with a basic indexing interface?The text was updated successfully, but these errors were encountered: