From 81ded0b9077164820faf9c84f9b07d968d1849fa Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Tue, 3 Dec 2013 01:07:56 +0900 Subject: [PATCH] fix forward_clist iterator --- sprout/forward_clist.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sprout/forward_clist.hpp b/sprout/forward_clist.hpp index 4722fa48..edf79f43 100644 --- a/sprout/forward_clist.hpp +++ b/sprout/forward_clist.hpp @@ -116,6 +116,9 @@ namespace sprout { ++*this; return result; } + SPROUT_CONSTEXPR bool is_initialized() const SPROUT_NOEXCEPT { + return item->is_initialized(); + } }; template @@ -124,7 +127,7 @@ namespace sprout { bool >::type operator==(sprout::detail::forward_item_iterator const& lhs, sprout::detail::forward_item_iterator const& rhs) { - return &*lhs == &*rhs; + return !(lhs.is_initialized() || rhs.is_initialized()) || &*lhs == &*rhs; } template inline SPROUT_CONSTEXPR typename std::enable_if<