Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow different containers for gradeschool

Open
#357 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
testing-qa

Research direction

Start by locating the grade-school exercise tests and reviewing how the student container type is currently constrained. Compare the proposed std::set/std::multiset expectation with accepting any suitable container via std::result_of; done means the chosen approach is implemented and tests cover the relevant container behavior.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C++
Stars
291
Forks
244
Avg merge
17m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/cpp

All issues in exercism/cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.