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

Const generics #168

Closed
kpp opened this issue Jul 11, 2020 · 12 comments · Fixed by #198
Closed

Const generics #168

kpp opened this issue Jul 11, 2020 · 12 comments · Fixed by #198

Comments

@kpp
Copy link
Contributor

kpp commented Jul 11, 2020

Const generics are getting more popular. I can try to implement heapless using const generics and push it into a separate branch until they are stable. It is a nice challenge both for coding skills and for const generics.
Shall I start?

@XOSplicer
Copy link
Contributor

Reference #102

@burrbull
Copy link
Member

@kpp Try if you can.
9 months have passed since my last attempt. Maybe something has changed in good way.

@korken89
Copy link
Contributor

@perlindgren has done the conversion, we are just awaiting stabilization to make a PR.

@kpp
Copy link
Contributor Author

kpp commented Sep 18, 2020

How about make a WIP PR so no one else tries to do it on their own?

@korken89
Copy link
Contributor

@perlindgren Could you make a WIP PR with the conversion work you did?

@korken89
Copy link
Contributor

For reference the work is being done here: https://github.com/perlindgren/heapless/tree/const_generics

@perlindgren
Copy link
Contributor

Everything is implemented and the code passes all tests.

There are some type bounds that needs to be added for ensuring power 2, I don't recall exactly. These were provided by GenericArray previously, not sure if we want to define/implement them ourselves, or if these are available elsewhere.

@tarcieri
Copy link

tarcieri commented Feb 3, 2021

Perhaps I should ask on the as-slice repo, but there is a plan for it and const generics?

I ask because as of #189 heapless is now pulling in three versions of generic-array (v0.12, v0.13, v0.14)

@korken89
Copy link
Contributor

korken89 commented Feb 3, 2021

Technically, when const generics lands, all code related to generic-array will disappear as there is no longer any need for it.
This is also what we have done in the port of heapless. For as-slice I will do the same and remove all the code related to generic-array and specific array size implementations.

@burrbull
Copy link
Member

burrbull commented Feb 3, 2021

8 days before beta.

@burrbull
Copy link
Member

Time

@korken89
Copy link
Contributor

Here you can follow the work, we almost finished the port https://github.com/japaric/heapless/tree/const_generics

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 a pull request may close this issue.

6 participants