Correct template parameters to std::iterator base of TrackIter...

... so that std::reverse_iterator<TrackIter<T>> works right, not making a
subtle error of return of reference to a temporary in its operator * with some
compilers.
This commit is contained in:
Paul Licameli 2018-10-03 22:41:57 -04:00
parent 50f2b0e860
commit 75918918c4
1 changed files with 8 additions and 1 deletions

View File

@ -818,7 +818,14 @@ template <
typename TrackType // Track or a subclass, maybe const-qualified
> class TrackIter
: public std::iterator<
std::bidirectional_iterator_tag, TrackType *const
std::bidirectional_iterator_tag,
TrackType *const,
ptrdiff_t,
// pointer is void to disable operator -> in the reverse_iterator...
void,
// ... because what operator * returns is really a value type,
// so you can't take its address
TrackType *const
>
{
public: