Closed dinghram closed 6 years ago
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
Fixed
Thanks
On Thu, Jun 21, 2018 at 12:55 AM mattreecebentley notifications@github.com wrote:
Fixed
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mattreecebentley/plf_list/issues/8#issuecomment-398996138, or mute the thread https://github.com/notifications/unsubscribe-auth/AWCfOTQQe9sti_Me6rLLBe_H7JzDtKWKks5t-0NNgaJpZM4UwBMN .
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