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

Better error messages when students use custom types in collections. #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

htiek
Copy link
Collaborator

@htiek htiek commented Jul 19, 2022

This edit introduces a bunch of extra static_assert checks that give cleaner error messages when students interact with our container types. For example, if you make a Vector<T> for a custom type T that isn't hashable, then calling hashCode on that vector gives a sensible error message about needing to define a hash code for the custom type. The same is true for relational operators, stream insertion, and stream extraction, and these assertions are there for all our containers, not just Vector.

This is essentially a fix for #65 but goes much beyond the Vector type.

@htiek htiek requested a review from zelenski July 19, 2022 19:02
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 this pull request may close these issues.

1 participant