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

sizehint! based on size of backing array #37

Open
frankier opened this issue Nov 16, 2023 · 1 comment
Open

sizehint! based on size of backing array #37

frankier opened this issue Nov 16, 2023 · 1 comment

Comments

@frankier
Copy link

It is sometimes that case I'm constructing a VectorOfArrays and I know what size the backing array will be as well as the number of arrays they will constitute. Would it be useful to add a:

function Base.sizehint!(A::VectorOfArrays{T,N}, n, s::Int) where {T,N}

Overload for this situation? Happy to put together a PR if there's agreement this is helpful.

@oschulz
Copy link
Collaborator

oschulz commented Nov 16, 2023

Sounds good - the question is, how do we express the size that we expect for the inner arrays in a way that fits the API of sizehint!?

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

No branches or pull requests

2 participants