cplusplus / cplusplus/draft

Replace post-increment and post-decrement boilerplate for iterators

Open
#4,690 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

lwg
Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

Many iterators defined in the library repeat the same wording:

Effects: Equivalent to:

auto tmp = *this;
++*this;
return tmp;

We should add front matter which says that when no detailed specification is present for operator++(int) it has the semantics shown above, and the equivalent with -- for operator--(int).

This would probably belong in [functions.within.classes].

This touches a lot of the library and should probably get checked by LWG, but still seems editorial to me.

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.

Research direction

Start with [functions.within.classes], the location suggested by the issue, and inventory the repeated operator++(int) and operator--(int) specifications across the library. Confirm that the proposed front matter covers cases without detailed specifications, then verify the boilerplate can be replaced consistently and prepare the result for the indicated LWG review.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.