exercism / exercism/cpp

Allow different containers for gradeschool

Open
#357 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
290
Forks
244
PR merge metrics
No merged PRs in 30d

Description

In grade school the container is chosen to be `map>` a better choice would be `std::set` or `std::multiset` 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.