Skip to content

Replace post-increment and post-decrement boilerplate for iterators #4690

Open
@jwakely

Description

@jwakely

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lwgIssue must be reviewed by LWG.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions