Uh oh!
There was an error while loading. Please reload this page.
Blockrng: template over element type - #303
Conversation
dhardy
commented
Mar 15, 2018
@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. |
pitdicker
commented
Mar 15, 2018
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? |
dhardy
commented
Mar 15, 2018
Ugh, yes, I forgot to commit the merge before modifying. I'll try but otherwise you might have to fetch and use git diff. |
dhardy
commented
Mar 15, 2018
That should do it. I actually had to use patch to apply the changes after merging; git rebase simply dropped my changes. |
pitdicker
commented
Mar 15, 2018
Thanks, and looks good! Do you think your changes do the trick to make |
dhardy
commented
Mar 15, 2018
To be honest I don't fully understand specialisation, but your definition: only allowed the type to exist for |
pitdicker
commented
Mar 15, 2018
Even better. Do you think it is time to merge? |
burdges
commented
Mar 15, 2018
I asked this elsewhere but I'd think replacing |
pitdicker
commented
Mar 15, 2018
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 |
dhardy
commented
Mar 15, 2018
@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 |
dhardy
commented
Mar 16, 2018
@pitdicker has a point; it would be nice to have this merged! I'll try the |
pitdicker
commented
Mar 16, 2018
🎉 |
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 theu32should 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).