Skip to content
This repository was archived by the owner on Dec 13, 2021. It is now read-only.
This repository was archived by the owner on Dec 13, 2021. It is now read-only.

Return value of operator* should be reference/const_reference #2

Description

@fuchsto

RVO will probably save your derrière but you have to define reference for iterator traits to work anyways:

const ValueT operator*() const { return _con[_offset]; }

Well, or use decltype(auto). Actually you are missing all iterator member types required by iterator traits:

https://de.cppreference.com/w/cpp/iterator/iterator_traits

Namely:

Iterator::difference_type
Iterator::value_type
Iterator::pointer
Iterator::reference
Iterator::iterator_category

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions