MariusHerget/LMU-SS18-cpppc

Return value of operator* should be reference/const_reference

fuchsto opened this issue · 0 comments

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