Skip to content

Iterator arithmetic #98

@pdigiglio

Description

@pdigiglio

I suggest we use the standard functions std::next, std::prev, std::advance and so on instead of operators like ++, --, and += to perform iterator arithmetic. In particular, std::next and std::prev are guaranteed to work on rvalues while the operators may not:

++c.begin();          // may not compile
std::next(c.begin()); // surely compiles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions