Skip to content

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

Open
htiek wants to merge 1 commit intomasterfrom
improved-static-asserts
Open

Better error messages when students use custom types in collections.#71
htiek wants to merge 1 commit intomasterfrom
improved-static-asserts

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