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

Allow different containers for gradeschool #357

Open
elyashiv opened this issue Jul 22, 2020 · 0 comments
Open

Allow different containers for gradeschool #357

elyashiv opened this issue Jul 22, 2020 · 0 comments

Comments

@elyashiv
Copy link
Contributor

In grade school the container is chosen to be map<int, vector<string>> a better choice would be std::set<string> or std::multiset<string> instead of vector, because the list of students needs to stay sorted.

I see two ways to fix this:

  1. Change the tests to expect a std::set or std::mutliset
  2. Change the tests accept any type of container, as long as it compiles. We can do this using the std::result_of trait.

The second approach gives a student more room to play with things, while it can make it harder to understand what fails to compile/what the tests actually check. It will also require a better testing framework, as we would want to test a few examples.

This might be true also for other exercises.

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

No branches or pull requests

1 participant