Repository navigation
Add working std::unordered_map overloads - #70
Conversation
47ade4b to
c52376c
Compare
teor2345
left a comment
There was a problem hiding this comment.
Thank you, this looks good to me!
Please move on to steps 2 and 3, no need to wait for reviews in between them.
Outreachy applications are due next Monday 9 November, please remember to put your application in before the deadline. You can include any Rust PRs you worked on during that time.
c52376c to
5e4cd27
Compare
5e4cd27 to
20e26a2
Compare
|
@teor2345 , All has been worked upon. Am now working on my application. |
teor2345
left a comment
There was a problem hiding this comment.
Thanks, just a few things to tweak here
59d09d6 to
d3244bf
Compare
|
HELLO @teor2345 , help me with the review and approve the checks |
teor2345
left a comment
There was a problem hiding this comment.
Looks like the documentation needs to be fixed up
7eb798f to
7a37478
Compare
|
Thanks for the feedback, Suggestions have been worked on @teor2345 |
teor2345
left a comment
There was a problem hiding this comment.
Just some minor fixes needed, then we can merge
7a37478 to
ac9956f
Compare
|
hey @teor2345 , all well fixed. Thanks for the review! |
teor2345
left a comment
There was a problem hiding this comment.
Thank you, this looks reasonably complete.
You are welcome to open another PR if you'd like to add anything else to these files. Adding more is optional. Please also feel free to focus on applying for projects, or feel free to take a break.
Please remember to put in an Outreachy application before by Monday 9 November!
|
Thanks for the merge @teor2345 |
Description:
This PR adds Rust Wrappers for C++ std::unordered_map overloads.
Implements issue: #67
Changes
Added Files:
Implementation Details
The implementation wraps the following overloaded method names from std::unordered_map<int, int>:
Constructors:
Accessors:
Modifiers:
Limitations / Ergonomics
insert-with-hint anderaseinsertdoesn't overwrite, unlike Rust'sHashMap::insert.new(bucket_count)keeps the C++'s default hash or equal given the fact that Rust has no default arguments.Testing
Comprehensive tests for each overload set verify:
Correct constructor is called based on arguments
Bucket count constructor actually allocates buckets
Copy constructor preserves original
Move constructor empties original
Find returns correct iterator or end iterator
Insert doesn't replace existing keys
Insert with hint works regardless of hint position
Erase removes correct elements## Outreachy Application Process
AI Usage:
I have used AI to first understand what the Issue needs me to do exactly. Then Used it to explain more of what is being talked about in this web Page: std::unordered_map.
I studied the forward_list.rs implementation to understand the used patterns, then wrote the unordered_map.rs file implementation from scratch based on that understanding and the explanation obtained from AI.
Tasks
Limitationsdoc sectionErgonomicsdoc sectionIncompatibilitiesdoc sectionWorkaroundsdoc sectionInexpressible Overloadsdoc sectionMark items in this checklist as done by clicking the box next to each item.
Needs Review @teor2345