From 20f14b4aa6311d8fb2ed80c47bb15e8d87d2f6b3 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 21 Dec 2018 15:19:22 -0500 Subject: [PATCH] [iter] Fix __end__() --- src/hb-iter.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index a919d4e32..775fba46f 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -84,9 +84,9 @@ struct hb_iter_t item_t& __item__ () const { return thiz()->item_at (0); } item_t& __item_at__ (unsigned i) const { return *(thiz() + i); } - /* Termination: Implement __more__() or __end__(). */ - bool __more__ () const { return item () != thiz()->__end__ (); } - const item_t& __end__ () const { return iter_t::__sentinel__; } + /* Termination: Implement __more__(), or __end__() and operator ==. */ + bool __more__ () const { return !(*thiz() == thiz()->__end__ ()); } + iter_t __end__ () const; /* Advancing: Implement __next__(), or __forward__() if random-access. */ void __next__ () { thiz()->forward (1); }