-
Notifications
You must be signed in to change notification settings - Fork 432
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
Blockrng: template over element type #303
Conversation
@pitdicker I should say that I re-reviewed at the same time and I'm happy to merge this. I don't really mind if you prefer not to template over the element type, but I don't think specialisation will allow other element types without this. |
Thank you! I look forward to seeing what improvements you made. Github has some trouble showing me what changed in the last commit. Can you please make two separate commits, one the merge with master and one your changes? |
Ugh, yes, I forgot to commit the merge before modifying. I'll try but otherwise you might have to fetch and use git diff. |
That should do it. I actually had to use patch to apply the changes after merging; git rebase simply dropped my changes. |
Thanks, and looks good! Do you think your changes do the trick to make |
To be honest I don't fully understand specialisation, but your definition:
only allowed the type to exist for |
Even better. Do you think it is time to merge? |
I asked this elsewhere but I'd think replacing |
I once did a try with an associated type, but couldn't really get it to work. Can't remember the details though, and you two are much more knowledgeable... pitdicker@bf44bb1 |
@burdges in response to your notes.. I tried making A surprising consequence of the above is that we need to both specify the After the above, I tried making the impl of Note that we don't need to use specialisation at all; we can just have two separate impls, one for each What we could do instead, once specialisation is available, is have a generic implementation with Allowing |
At worst, some private helper trait In any case, an associated type |
@pitdicker has a point; it would be nice to have this merged! I'll try the |
🎉 |
Blockrng: template over element type
#281 merged with master plus one extra commit.
It is annoying that one must now specify e.g.
BlockRng::<u32, ChaChaCore>
when theu32
should be deducible, but this way we allow other element types and generic reseeding code over the element type (except for one thing I couldn't get quite right).