hsf-training / hsf-training/cpluspluscourse
About operators exercise
Open
Nobody has claimed this yet.
stale
- Dominant language
- TeX
- Stars
- 313
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
I found it too too long. Few suggestions to better focus on operators only:
- Provide in the original code the normalize() function and std::gcd stuff.
- Provide int the original code the constructors, public attributes, constructors,
assignmethod, and externals functions such asmultiply,add,compare(returning -1,0,1 ?),print. - Ask to replace the functions with operators: =, +, *, <=>, <<
- Then ask to add, reusing previous ones: !=, +=, *=.
- Show that with <=> implemented, then <, <=, >, >= are automatically infered ?
- Optionally, make all the assignments returning *this, like in operator<<, and explain this permit chaining.
- Optionally, make them move the operators as inline friend functions, and make attributes private.
- Optionnaly, discuss the pros and cons of making the unary constructor explicit.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the operators exercise and reviewing its current instructions, especially the existing normalize() and std::gcd material. Compare the exercise with the proposed operator-focused sequence, including constructors, arithmetic and comparison operators, compound assignments, chaining, and optional design discussions; done means the exercise is shorter and its operator scope is clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100