diff --git a/icu4c/source/common/uchriter.cpp b/icu4c/source/common/uchriter.cpp index fa831af4fb4..78982c35872 100644 --- a/icu4c/source/common/uchriter.cpp +++ b/icu4c/source/common/uchriter.cpp @@ -166,7 +166,7 @@ UCharCharacterIterator::nextPostInc() { } UBool -UCharCharacterIterator::hasNext() { +UCharCharacterIterator::hasNext() const { return (UBool)(pos < end ? TRUE : FALSE); } diff --git a/icu4c/source/common/unicode/chariter.h b/icu4c/source/common/unicode/chariter.h index 6ce09fca48d..8133a4cabf6 100644 --- a/icu4c/source/common/unicode/chariter.h +++ b/icu4c/source/common/unicode/chariter.h @@ -164,7 +164,7 @@ public: * at or after the current position in the iteration range. * @stable ICU 2.0 */ - virtual UBool hasNext() = 0; + virtual UBool hasNext() const = 0; protected: /** Default constructor to be overridden in the implementing class. @stable ICU 2.0*/ diff --git a/icu4c/source/common/unicode/uchriter.h b/icu4c/source/common/unicode/uchriter.h index 4c4caa3e575..786c66823b2 100644 --- a/icu4c/source/common/unicode/uchriter.h +++ b/icu4c/source/common/unicode/uchriter.h @@ -272,7 +272,7 @@ public: * at or after the current position in the iteration range. * @stable ICU 2.0 */ - virtual UBool hasNext(); + virtual UBool hasNext() const; /** * Advances to the previous code unit in the iteration range (toward