You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks the original reason I didn't do this was because I figured since the iterator is just a pointer anyway, returning a pointer to a pointer (reference) would incur a performance cost -
having done some benchmarking this is not the case, and you're correct that this is a standards compliance "thing". https://en.cppreference.com/w/cpp/language/operator_incdec
For parity with std::list, (at least in Visual Studio), the following should return a reference to the list_iterator, rather than a copy:
inline PLF_LIST_FORCE_INLINE list_iterator operator ++ () PLF_LIST_NOEXCEPT
inline PLF_LIST_FORCE_INLINE list_iterator operator -- () PLF_LIST_NOEXCEPT
inline list_iterator operator = (const list_iterator &rh) PLF_LIST_NOEXCEPT
inline list_iterator operator = (const list_iterator &&rh) PLF_LIST_NOEXCEPT
inline PLF_LIST_FORCE_INLINE list_reverse_iterator operator ++ () PLF_LIST_NOEXCEPT
inline PLF_LIST_FORCE_INLINE list_reverse_iterator operator -- () PLF_LIST_NOEXCEPT
inline list_reverse_iterator operator = (const list_reverse_iterator &rh) PLF_LIST_NOEXCEPT
inline list_reverse_iterator operator = (const list_reverse_iterator &&rh) PLF_LIST_NOEXCEPT
The text was updated successfully, but these errors were encountered: